September 21, 2017

How to dump 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