Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created April 4, 2015 06:01
Show Gist options
  • Save jordanhudgens/7c3822fca6723982e685 to your computer and use it in GitHub Desktop.
Save jordanhudgens/7c3822fca6723982e685 to your computer and use it in GitHub Desktop.
# Run this command to create a database backup
$ heroku pgbackups:capture
# Run this to download the database dump locally
$ curl -o latest.dump `heroku pgbackups:url`
# Run this to restore the db contents locally (substituting myuser/mydb to match the database.yml file contents)
$ 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