Last active
April 3, 2018 14:42
-
-
Save BartlomiejSkwira/0a9912e92c34c0a8ac49df45cb1f2e0c to your computer and use it in GitHub Desktop.
Backup and restore postgres in Docker
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
#Backup your databases | |
docker exec -u <your_postgres_user> <postgres_container_name> pg_dump -Fc <db_name> > db.dump | |
#Restore your databases | |
docker exec -i -u <your_postgres_user> <postgres_container_name> pg_restore -C -d <db_name> < db.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment