Skip to content

Create a backup

Buuck keeps all of your data in one database. Create a backup of the database each day.

Write the backup to a file:

Terminal window
cd /opt/buuck
docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > buuck-$(date +%F).sql

Also create a copy of your .env file. Keep both files on a different machine.

To load a backup into the database, use this command. Replace BACKUP-FILE with the name of the backup file:

Terminal window
cd /opt/buuck
docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB"' < BACKUP-FILE.sql