Skip to content

Instantly share code, notes, and snippets.

@ciniglio
Created February 19, 2013 15:22
Show Gist options
  • Save ciniglio/4986817 to your computer and use it in GitHub Desktop.
Save ciniglio/4986817 to your computer and use it in GitHub Desktop.
Exporting db from heroku and using it in development
heroku pgbackups --app APP_NAME 
heroku pgbackups:capture --expire --app APP_NAME # Force a new backup
curl `heroku pgbackups:url --app APP_NAME` -o ~/Desktop/dump #download last backup
pg_restore -c -U username -d database_name_env ~/Desktop/dump # load dump into db (cleanly)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment