Last active
August 29, 2015 14:15
-
-
Save imaginationcoder/c476863cecaa68a2e251 to your computer and use it in GitHub Desktop.
Dump Heroku Postgres DB locally
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
1) Add pgbackups add-on to project | |
# heroku addons:add pgbackups | |
2) heroku pgbackups:capture | |
3) curl -o latest.dump `heroku pgbackups:url` | |
4) Then "Translate" it into a postgres db with | |
# pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump | |
(your database must exist before can do this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment