Skip to content

Instantly share code, notes, and snippets.

@mikedijkstra
Last active December 16, 2015 06:29
Show Gist options
  • Save mikedijkstra/5392032 to your computer and use it in GitHub Desktop.
Save mikedijkstra/5392032 to your computer and use it in GitHub Desktop.
Download Postgres backup from Heroku

Make a backup: heroku pgbackups:capture or heroku pgbackups:capture --expire

Get the URL: heroku pgbackups:url

Download: curl -o latest.dump "URL"

Import: $ 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