Skip to content

Instantly share code, notes, and snippets.

@filipwodnicki
Last active June 10, 2019 14:06
Show Gist options
  • Save filipwodnicki/2ad7705f5088cd20a6ff0bce64f0cde9 to your computer and use it in GitHub Desktop.
Save filipwodnicki/2ad7705f5088cd20a6ff0bce64f0cde9 to your computer and use it in GitHub Desktop.
use heroku database dump to populate local database
# Download heroku database dump and run pg restore on it to populate local db
## Source: https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e
## link: https://data.heroku.com/datastores/
# prep: download the heroku dump from heroku > Databases > durability
psql
postgres=# drop database if exists replace_this_with_your_database_name;
postgres=# create database replace_this_with_your_database_name;
postgres=# grant all priviliges on replace_this_with_your_database_name to postgres;
postgres=# \q
pg_restore -U postgres -d pipa_dump path_to_backup_file_on_your_machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment