Backups - DDMAL/CantusDB GitHub Wiki

The CantusDB Staging and Production servers are set up to automatically be backed up periodically.

Location

Past backups of the database can be found in the /home/ubuntu/backups/postgres/ directory on the relevant server.

Scheduling

Backups are triggered by cron, and scheduling information for these backups can be found in the cron role of the CantusDB ansible set-up.

Retention

We retain a limited number of daily (we keep 7), weekly (8) and monthly (12) backups, and an unlimited number of annual backups. Within /home/ubuntu/backups/postgres/, these can be found in the daily/, weekly/, monthly/ and yearly/ directories respectively. Logic outlining the retention of backups can be found in CantusDB/cron/postgres/db_backup.sh.

Manual backups

A manual database dump can be created by ssh-ing into the relevant server and running docker-compose exec postgres pg_dump cantusdb -U cantusdb > ~/cantus_dump.sql.