Docker Community Forums

Share and learn in the Docker community.

First time using docker: HOW TO BACKUP : Odoo 14.0-20201002 (Community Edition) + postgres installed in a Synology NAS

I know this is a very specific topic, but maybe someone here could help.

My first docker experience has finally arrived trying to configure ODOO + postrges.

I’ve installed Postgres and Odoo in my Synology NAS using docker.

After following the right steps in the docker assistants all works fine.

Synology offers a backup program that can backup files and folders.

I would like to be sure that I can backup all the docker related things (Odoo + postgress database and configurations) to be able to delete it all, install both packages again and then just recover my backup in case of a total disaster / data corruption…

In case of Postgres I’ve mounted the /var/lib/postgresql/data folder in a normal folder in my Synology. This should allow the native backup program to copy that folder every night.

But I don’t know which folders should I expose in the Odoo docker container to be on the safe side, neither the best practice in order to be able to recover completely both containers without problems.

How can I know which folders to expose to the Synology NAS to be on the safe side?

I would like to be able to snapshot both packages automatically every night, keeping a complete backup history.

Do you know of any link to instructions that explain how to do it?

As an example, today I’ve stopped the odoo container and when I tried to restart it, nothing worked, and I’ve needed to delete it all, create both containers again… of course I can’t try to use this setup on production without a proper recovery protocol/option.

Any help about this will be very welcome.

Thank you very much in advance for your time and help.

You should follow the instructions from Odoo to create a reliable backup of such a complicated system.
About Postgres: If you mount a local folder into /var/lib/postgresql/data you can only copy it if the database is shut down. A more secure way is to use pg_dump, but again you need informations about which databases have to be included in the backup.

This means something is wrong with the design of your system. A container is ephemeral, you should always be able to stop and restart it within seconds.