Skip to content

Instantly share code, notes, and snippets.

@jiaaro
Created September 13, 2013 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiaaro/6556509 to your computer and use it in GitHub Desktop.
Save jiaaro/6556509 to your computer and use it in GitHub Desktop.
# add new database to addons before running this
# fill in the blank
# eg. DBNAME=HEROKU_POSTGRESQL_ROSE <- new Database
DBNAME=HEROKU_POSTGRESQL_ROSE
heroku maintenance:on
heroku scale web=0
heroku pgbackups:capture --expire
# prompts for confirmation
heroku pgbackups:restore $DBNAME
heroku pg:promote $DBNAME
heroku maintenance:off
heroku scale web=2
# remove old database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment