Created
December 13, 2014 00:26
-
-
Save fairchild/35f1393648c598174ad4 to your computer and use it in GitHub Desktop.
example script to upgrade a heroku postgresql database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
export APP_NAME=staging-webfarmforeman | |
export NEW_DB_NAME=HEROKU_POSTGRESQL_JADE | |
heroku addons:add pgbackups --app $APP_NAME | |
heroku addons:add heroku-postgresql:hobby-basic --app $APP_NAME | |
heroku pg:wait --app $APP_NAME | |
heroku maintenance:on --app $APP_NAME | |
# heroku ps:scale worker=0 --app $APP_NAME | |
heroku pgbackups:transfer DATABASE_URL ${NEW_DB_NAME}_URL --app $APP_NAME | |
heroku pg:promote $NEW_DB_NAME | |
heroku maintenance:on --app $APP_NAME | |
# heroku ps:scale worker=1 --app $APP_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment