Thanks Rémi, but result is the same when I start only the db container, even after a full cleanup (docker container rm docker-compose_db_1 && docker volume rm lava-server-pgdata): ERROR: database "lavaserver" already exists
Seems to be related somehow to "POSTGRES_USER: lavaserver" in docker-compose.yaml. Reading the entrypoint script for postgres (https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh), I thought using PGUSER could help, but I didn't manage yet to get that working. I will continue digging into this... but if you have a detailed procedure somewhere, please share 😊
Thanks a lot!
Philippe
From: Lava-users lava-users-bounces@lists.lavasoftware.org On Behalf Of Remi Duraffort Sent: Monday, March 22, 2021 9:25 AM To: Philippe Mazet (OSS) philippe.mazet@oss.nxp.com Cc: lava-users@lists.lavasoftware.org lava-users@lavasoftware.org Subject: Re: [Lava-users] LAVA master backup/restore
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
Hello Philippe,
I haven't tried so I don't have the detailed procedure. When you find out, could you share the procedure ?
Thanks
Le mar. 23 mars 2021 à 11:28, Philippe Mazet (OSS) < philippe.mazet@oss.nxp.com> a écrit :
Thanks Rémi, but result is the same when I start only the db container, even after a full cleanup (docker container rm docker-compose_db_1 && docker volume rm lava-server-pgdata): ERROR: database "lavaserver" already exists
Seems to be related somehow to "POSTGRES_USER: lavaserver" in docker-compose.yaml. Reading the entrypoint script for postgres ( https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh), I thought using PGUSER could help, but I didn't manage yet to get that working. I will continue digging into this... but if you have a detailed procedure somewhere, please share 😊
Thanks a lot!
Philippe
From: Lava-users lava-users-bounces@lists.lavasoftware.org On Behalf Of Remi Duraffort Sent: Monday, March 22, 2021 9:25 AM To: Philippe Mazet (OSS) philippe.mazet@oss.nxp.com Cc: lava-users@lists.lavasoftware.org lava-users@lavasoftware.org Subject: Re: [Lava-users] LAVA master backup/restore
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
lava-users@lists.lavasoftware.org