Le jeu. 18 mars 2021 à 16:22, Philippe Mazet (OSS) <philippe.mazet@oss.nxp.com> a écrit :
Hi all,

I am using the docker-compose solution to run a master: https://git.lavasoftware.org/lava/pkg/docker-compose
I was wondering how to extract a backup of the DB, and re-inject it in a different instance.

I found that postgres image has its own "restore" mechanism, based on initdb.d folder, as mentioned in the documentation:
https://registry.hub.docker.com/_/postgres/

The entrypoint.sh script (https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh) handles the restore whenever the folder is /docker-entrypoint-initdb.d/ contains a .sql file.

But when we store a backup in the container's  /docker-entrypoint-initdb.d/ folder, and remove both the postgres image and its db-data volume, we get this error on next start:
ERROR:  database "lavaserver" already exists
Full startup log attached.

Questions:
- Does Linaro's docker-compose solution modify postgres restore mechanism in any way?
 
I guess that's only because lava will automatically create an empty lavaserver database. So in your use case, you should only start the db service and not any lava-* services. When the restoration has been done, you can restart every lava services.
 
- How do you handle backup/restore at linaro?

Thanks a lot in advance,


Philippe Mazet
NXP Semiconductors - Edge Processing
Email: philippe.mazet@nxp.com



_______________________________________________
Lava-users mailing list
Lava-users@lists.lavasoftware.org
https://lists.lavasoftware.org/mailman/listinfo/lava-users


--
Rémi Duraffort
LAVA Architect
Linaro