Created
October 4, 2020 08:42
-
-
Save xenups/af9c33bff0c7de70f7e5f169c650ea04 to your computer and use it in GitHub Desktop.
How to back up docker postgres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to create a backup | |
docker exec -t <container-id> pg_dumpall -c -U postgres_user > backup.sql | |
to restore it : | |
cat backup.sql | docker exec -i postgres psql -U postgres_user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment