Backup
Backing up Buddy Self-Hosted
When you perform a backup, the system creates a tar.gz
archive with all repositories and databases of your Buddy self-hosted 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:
bashbuddy stop
$Run this command to perform backup:
bashbuddy backup
$HintUse 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 self-hosted 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
TipIf 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 self-hosted from a backup file:
Stop the app with this command:
bashbuddy stop
$Run this command:
bashbuddy 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 Self-Hosted to another server
To relocate your self-hosted installation and data, follow these steps:
Stop the application:
bashbuddy stop
$Perform a backup:
bashbuddy backup
$HintUse 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 self-hosted on the target server using the backup file:
bashcurl -sSL https://get.buddy.works | sh && buddy --backup={PATH_TO_BACKUP_FILE} install
$
Sep 24, 2024