Skip to content

Instantly share code, notes, and snippets.

@jeffreyjurgajtis
Created June 11, 2015 15:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffreyjurgajtis/a731b9c779656309c06c to your computer and use it in GitHub Desktop.
Save jeffreyjurgajtis/a731b9c779656309c06c to your computer and use it in GitHub Desktop.
Heroku Postgres DB to local Postgres DB
Details:
https://devcenter.heroku.com/articles/heroku-postgres-backups
$ heroku pg:backups capture #=> <backup_number>
$ heroku pg:backups public-url <backup_number> #=> <backup_url>
$ curl -o latest.dump <backup_url>
(drop and re-create local database)
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment