What’s the best way to back up Nextcloud or WordPress running in Docker?

0
0
Asked By MellowCedar42 On

For a Docker-based Nextcloud or WordPress setup, I'm planning to use borgmatic and back up both the application files/volumes and the database. For an automated nightly backup, is a command such as `mysqldump --single-transaction` enough without enabling maintenance mode, or should I briefly put the application into maintenance mode so the database dump and file backup represent the same point in time? I'd also like to know what backup and restore process others use.

3 Answers

Answered By BriskWalnut19 On

Back up both pieces separately: export the database with a transactional dump and preserve the persistent Docker volumes containing uploads, configuration, and application data. If you can take a filesystem or VM snapshot, that makes it easier to capture the files and database at nearly the same point in time. Keep multiple generations and verify that you can rebuild the containers and restore from scratch.

Answered By LunarKite_58 On

For smaller installations, backing up the persistent volumes and database dumps to separate storage is usually sufficient. Some people handle this at the host or VM level instead, using scheduled VM backups and a separate sync tool for important user data. Whichever method you choose, don’t rely on volume copies alone—make sure the database is exported properly and perform occasional recovery tests.

Answered By QuartzPanda7 On

`--single-transaction` gives you a consistent snapshot of the database itself, but it doesn’t coordinate with files that are being uploaded or modified at the same time. The safest approach is a short maintenance window: pause changes, dump the database, back up or snapshot the application volumes, then bring everything back online. The most important part is regularly testing a full restore, since a backup job completing successfully doesn’t prove the backup is usable.

MellowCedar42 -

Would a low-traffic window around 3 AM be good enough without maintenance mode for Nextcloud or WordPress, or is the consistency risk still significant?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.