-
Hi, I am rather new to docker. What would the best way to backup the Manyfold database be? I know you need to stop the database before running a backup to avoid corruption, but unsure how to do that in docker. Secondary question, what parts/directories of Manyfold would be needed to restore from backup? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It depends what database you're using, but it's basically the same as the standard backup procedure for that database. If it was SQLite, make sure you're saving the file, if postgres, I think it has specific backup tools available. As long as you back up the database and the library folders, you should be able to restore everything in the event of disaster. We should add a backup page to the website explaining this, with some actual instructions. I've added that as a task to the backlog. |
Beta Was this translation helpful? Give feedback.
-
Well, I used this opportunity to learn a fair bit. This can likely be improved, but here is a basic backup script i wrote and then set up to run in cron. It is modularized with variables to be easy to configure for your configuration (and be used for any PostgreSQL database set up with docker compose). This will backup a postgresql database for the service DockerService for a docker container made by a DockerCompose file located at BackupTarget, gzip it, and save it to the directory located at BackupLoc. It will name the file db-YYYYMMDDHHMMSS. If anyone has suggestions for improvements, lmk.
|
Beta Was this translation helpful? Give feedback.
Well, I used this opportunity to learn a fair bit.
This can likely be improved, but here is a basic backup script i wrote and then set up to run in cron. It is modularized with variables to be easy to configure for your configuration (and be used for any PostgreSQL database set up with docker compose).
This will backup a postgresql database for the service DockerService for a docker container made by a DockerCompose file located at BackupTarget, gzip it, and save it to the directory located at BackupLoc. It will name the file db-YYYYMMDDHHMMSS.
If anyone has suggestions for improvements, lmk.