Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Created December 4, 2012 18:26
Show Gist options
  • Save alexmcpherson/4207203 to your computer and use it in GitHub Desktop.
Save alexmcpherson/4207203 to your computer and use it in GitHub Desktop.
Upgrading a Heroku DB
Migrating to another DB plan in Heroku
# Provision new DB plan
heroku addons:add heroku-postgresql:basic --remote production
heroku pg:wait --remote production
# Prevent New Updates
heroku maintenance:on --remote production
heroku ps:scale worker=0 --remote production
# Capture Backup
heroku pgbackups:capture --expire --remote production
# Restore to New DB
heroku pgbackups:restore HEROKU_POSTGRESQL_NEW_COLOR_NAME --remote production
# Promote upgraded DB
heroku pg:promote HEROKU_POSTGRESQL_NEW_COLOR_NAME --remote production
# Make Application Active
heroku ps:scale worker=1 --remote production
heroku maintenance:off --remote production
# Remove Old Database
heroku addons:remove HEROKU_POSTGRESQL_OLD_COLOR_NAME --remote production
# Or you can use --app app-name OR just the defaults if you don't have multiple heroku remotes/apps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment