postgres-operator
postgres-operator copied to clipboard
Restore database from backrest to a bitnami postgres docker container image or official postgres docker container
I recently lost my whole k8s environment and I want to restore the database of PGO to an RDS on AWS. I accessed the S3 of backrest backups in the following path 'backrestrepo/<dbName>-backrest-shared-repo/backup/db', and downloaded them to my local linux host. Found a lot of directories that have the pg_data directories of daily backups. I ran a docker command mounting the latest backup of these repos to a bitnami/postgres container, and ran psql command with localhost and respective port, but I found nothing in the database as it was totally empty. I only found the default db postgres which is not the DB of the application. Please I need a fix for this asap as i need to restore my data.
I gunzipped all the contents of the directories then issued below command to run the DB in Docker:
$ docker run -v ~/20220210-010016F/pg_data:/bitnami/postgresql -p 5432:5432 -e ALLOW_EMPTY_PASSWORD=yes -u root bitnami/postgresql:12
Tried to mount the 'data' dir inside pg_data and also same result. Tried to mount a lot of backups of previous days/weeks before I lost my environment but all are empty as well.
@shift @jkatz @MiLk @larsks can you please help me here?
If you need immediate help, please see the support page. Otherwise, community members will answer issues as they have available time.
Thanks a lot @jmckulk ill do that and I appreciate replies here as well
@ali-alhajj98 If no one in the community has solved this problem and you need immediate assistance, you might try [email protected] for support.
Since it has been a while, I will close this ticket, but if you're still running into this problem, please reopen.