Docker Community Forums

Share and learn in the Docker community.

Best approach for persistent data backup

Dear Docker users,

I’ve spent a little bit time to dockerize almost everything and I must admit this is really smart now :slight_smile: My question now is about a clean backup process to ensure all persistent data are safely backed up. From a config files and other similar stuff there is no issue, I’m using Duplicati on my NFS server. My concern is about databases, in particular MySQL (a lot of apps are using db such as ZoneMiner, Wordpress, Piwigo and other) because running a backup job on a running db is a non sense from an integrity standpoint. This is nevertheless what I currently doing like a newbie.

I did make a lot of search but nothing satisfying so far. Using mysql-dump is to me not really satisfying. I would prefer from an integrity perspective just stop the docker container, issue the backup and restart the container.

Is my approach correct?

Not if you perform what MySQL calls a “hot backup”, which is not a free option though. For MariaDB with InnoDB, the open source Mariabackup supports hot backups too. And PostgreSQL supports Continuous Archiving and Point-in-Time Recovery (PITR). Maybe adding “hot backup” to your search terms helps?

Also, “replication” to a standby database comes to mind. Yet another search term. :wink:

Nice! I will have look. Many thanks for your help.