Created
September 13, 2013 21:47
-
-
Save jiaaro/6556509 to your computer and use it in GitHub Desktop.
db migrations on heroku. Docs: https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups
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
# 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