Skip to content

Instantly share code, notes, and snippets.

@diligasi
Last active October 15, 2019 17:05
Show Gist options
  • Save diligasi/0c2df7cfe14e2dccf60fc44fda2d5da9 to your computer and use it in GitHub Desktop.
Save diligasi/0c2df7cfe14e2dccf60fc44fda2d5da9 to your computer and use it in GitHub Desktop.
Generates a dump file from Heroku database, download it and restore locally
heroku pg:backups capture
heroku pg:backups public-url
curl "http://[url]" > production.dump
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb file.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment