Last active
June 29, 2018 05:10
-
-
Save trankimvu/913ed73719b4b65331e9503c603e3583 to your computer and use it in GitHub Desktop.
postgres dump and restore.sh
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
pg_dump --file=./dbname.20180626.tar --if-exists --clean --dbname=dbname --format=t --username=hyperloop --host=localhost --port=5432 | |
pg_restore --dbname=dbname --clean --if-exists --single-transaction --username=hyperloop --host=localhost --port=5432 ./dbname.20180626.tar | |
pg_dump postgres://username:password@ec2-00-00-100-100.eu-west-1.compute.amazonaws.com:5432/databasename | |
#Optionally you can add -f filename to specify a local filename. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment