Skip to content

Instantly share code, notes, and snippets.

@esteedqueen
Last active August 31, 2018 18:48
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 esteedqueen/25830d5263155da9ffc9016ca390bef9 to your computer and use it in GitHub Desktop.
Save esteedqueen/25830d5263155da9ffc9016ca390bef9 to your computer and use it in GitHub Desktop.
TIL - dumping production PG database into development PG database

Step 1 - Create a Backup and Download it

heroku pg:backups:capture
heroku pg:backups:download

Step 2 - Using pg_restore command

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U username -d development_dbname ~/Downloads/blah1234blah789

Reference

Importing and Exporting Heroku Postgres Databases with PG Backups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment