Skip to content

Instantly share code, notes, and snippets.

@imaginationcoder
Last active August 29, 2015 14:15
Show Gist options
  • Save imaginationcoder/c476863cecaa68a2e251 to your computer and use it in GitHub Desktop.
Save imaginationcoder/c476863cecaa68a2e251 to your computer and use it in GitHub Desktop.
Dump Heroku Postgres DB locally
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