Skip to content

Instantly share code, notes, and snippets.

@dtuite
Last active December 13, 2015 16:48
Show Gist options
  • Save dtuite/4942805 to your computer and use it in GitHub Desktop.
Save dtuite/4942805 to your computer and use it in GitHub Desktop.
Exporting the latest Heroku backup to your local machine
  1. Download the latest backup to a local file called latest.dump
curl -o latest.dump `heroku pgbackups:url -r production`
  1. Load the dump file into the local database. [username] and [database_name] can be found in the database.yml file.
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [username] -d [database_name] latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment