Created
December 9, 2012 21:19
-
-
Save zinkkrysty/4247065 to your computer and use it in GitHub Desktop.
Best way to export and import postgres databases
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
# https://devcenter.heroku.com/articles/heroku-postgres-import-export | |
# Import | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump | |
# Export | |
PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment