Backup and restore

Perform backup

Performing a backup will create a tar.gz archive with all repositories and databeses of your Buddy Enterprise installation.

  1. Log in to the machine where Buddy Enterprise is installed
  2. If the app is running, halt it with
buddy stop
  1. Run backup command
buddy backup

Executing the backup with a --full flag will make Buddy also backup cached files. However, this option is not recommended because of huge backup size.

Each execution will create a new archive.

The name of the archive is a unix timestamp describing the time of creation.

Backups are made to the application directory (default location: ~/.buddy/app/backups). If you’re running out of space, you can move the whole directory to another location.

Configure recurrent backups

If you’re a Linux or Mac OS user, you can use a cron to perform automatic backups (on Windows you can do the same with Task Scheduler). Here’s an example cron that will make a backup of your app once a day at 12.00 PM.

Execute crontab -e to open the editor and type

0 0 * * * ~/.buddy/app/backups/backup.sh

Contents of backup.sh:

buddy --yes stop
buddy --yes backup
buddy --yes start

Restore application from backup file

In order to restore your instance run

buddy restore

Provide the path to your backup file or hit enter to restore the last file from the default backup directory:

The command will restore installation from the latest backup file saved to the data path file

Backups are made to the application directory (default location: ~/.buddy/app/backups). If you’re running out of space, you can move the whole directory to another location using Buddy CLI.

Move Buddy Enterprise to another server

To relocate your Enterprise installation and data, follow these steps:

  1. Login to the server where Buddy Enterprise is installed and turn it off:
sudo buddy stop
  1. Perform a backup:
sudo buddy backup

If you want to backup the cache files, too, use: sudo buddy --full backup

  1. Buddy will inform you where the backup was saved. If you haven’t changed the Application data setting, the file will be saved in ~/.buddy/app/backups/ and named something like 1519120760.tar.gz.

  2. Move the file to the new server.

  3. Download the CLI and install Buddy from backup on the new server:

curl -sSL https://get.buddy.works | sh && sudo buddy --backup=path/to/backup install