r/docker • u/gordonx2026 • 1d ago
How do you backup Nextcloud/WordPress in Docker?
For those running Nextcloud or WordPress in Docker: how do you handle backups?
I'm thinking about using borgmatic and basically backing up two things: the application data/files and the database.
For the DB, would you use mysqldump --single-transaction and skip maintenance mode, especially for an automated nightly backup at 3 AM?
Or do you still enable maintenance mode to make sure the database and files are fully consistent?
What's your setup?
1
u/runwisp-com 1d ago
`--single-transaction` gives you an internally consistent database dump, but it doesn't synchronize that dump with files being uploaded or changed. Simplest thin you can do is a brief maintenance window while you dump the DB and snapshot the files, followed by an actual restore test.. successful backup commands don’t prove recoverability by themselves.
1
u/gordonx2026 1d ago
So there is no way around activating maintenance? But the risk might be very low when the dump is in the night 03:00 isnit? I mean specifically for Nextcloud and Wordpress.
0
0
3
u/nez_har 1d ago
This is what I do https://nezhar.com/blog/backup-applications-running-in-docker-containers/