Skip to content

Instantly share code, notes, and snippets.

@markbrown4
Created December 18, 2012 22:47
Show Gist options
  • Save markbrown4/4332798 to your computer and use it in GitHub Desktop.
Save markbrown4/4332798 to your computer and use it in GitHub Desktop.
heroku addons:add pgbackups
heroku addons:add heroku-postgresql:basic
heroku pg:wait
heroku pgbackups:capture --expire
heroku pgbackups:restore HEROKU_POSTGRESQL_COLOUR
heroku pg:promote HEROKU_POSTGRESQL_COLOUR
heroku addons:remove HEROKU_POSTGRESQL_COLOUR
------
restoring backups to local
heroku pgbackups:capture
curl -o latest.dump `heroku pgbackups:url`
pg_restore --verbose --clean --no-acl --no-owner -d mydb latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment