Skip to content

Instantly share code, notes, and snippets.

@zinkkrysty
Created December 9, 2012 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zinkkrysty/4247065 to your computer and use it in GitHub Desktop.
Save zinkkrysty/4247065 to your computer and use it in GitHub Desktop.
Best way to export and import postgres databases
# 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