Backup
Backing up Buddy On-Premises
When you perform a backup, the system creates a tar.gz
archive with all repositories and databases of your Buddy On-Premises installation.
~/.buddy/app/backups
. If you’re running out of space, you can move the directory to another location using Buddy CLI.
Every time you perform a backup, a new archive is created. The names of the archives are UNIX timestamps that record the date and time when a backup was created.
To perform a backup, follow these steps.
Stop the app with this command:
buddy stop
$Run this command to perform backup:
buddy backup
$Use thebuddy --full backup
command to include cached files in the backup. Depending on your setup, this can make the backup archive much bigger.
Configuring recurrent backups
On Linux and macOS you can use cron to perform automatic backups.
Follow these steps to create a cronjob that performs a backup of Buddy On-Premises once a day at 12.00 PM:
- Run
crontab -e
to open the cron table editor. Add this line that defines the job:
0 0 * * * ~/.buddy/app/backups/backup.sh
If you need help creating cron schedule expressions, check out this handy tool.- Go to
~/.buddy/app/backups/
and create abackup.sh
file. Add these lines to
backup.sh
:buddy --yes stop buddy --yes backup buddy --yes start
Restoring the application from a backup file
Follow these steps to restore Buddy On-Premises from a backup file:
Stop the app with this command:
buddy stop
$Run this command:
buddy restore
$Specify the path to the backup file. Alternatively, press
enter
to use the latest file from the default backup directory.
~/.buddy/app/backups
. If you’re running out of space, you can move the directory to another location using Buddy CLI.
Moving Buddy On-Premises to another server
To relocate your On-Premises installation and data, follow these steps:
Stop the application:
buddy stop
$Perform a backup:
buddy backup
$Use thebuddy --full backup
command to include cached files in the backup. Depending on your setup, this can make the backup archive much bigger.- Copy the created backup file to the target server. By default, backups are stored in
~/.buddy/app/backups
. Install Buddy On-Premises on the target server using the backup file:
curl -sSL https://get.buddy.works | sh && buddy --backup={PATH_TO_BACKUP_FILE} install
$
Last modified on September 8, 2022