Backup and restore proceduresΒΆ

Decapod with decapod-admin tool (a part of admin service) allows to create backup. If you have dockerized setup (i.e running with docker-compose) you need to setup backup procedure manually.

Decapod stores its state in MongoDB and in 99% of cases restoring of DB backups allows to restore all decapod data. Another 1% is internal container state, like a data from ceph-monitoring (check Ceph monitoring chapter for details). This data is ok to be lost since Decapod refresh it every 10 minutes by default (for urgent cases, it is even possbible to collect explicitly with docker-compose exec controller decapod-collect-data command).

To perform backup, just execute following:

$ docker-compose exec -T admin decapod-admin db backup > db_backup

And to restore:

$ docker exec -i $(docker-compose ps -q admin) admin decapod-admin restore < db_backup


At the time of writing, it was not possible to use docker-compose exec to perform restore due to the bug in docker-compose:

There are 2 scripts in ./scripts directory, and which does backup/restore for you.

$ ./scripts/ /var/backup/decapod_db
$ ./scripts/ /var/backup/decapod_db

You can add backup to cron like this:

0 */6 * * * /home/user/decapod_scripts/ -p decapod -f /home/user/decapod_runtime/docker-compose.yml /var/backups/decapod/decapod_$(date --iso-8601) > /var/log/cron.log 2>&1