Created
November 6, 2014 06:40
-
-
Save techieshark/27b6c2259c9e832656ba to your computer and use it in GitHub Desktop.
switch heroku db
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
# we had an existing postgres db on heroku and wanted to switch to another (larger or smaller) | |
heroku addons:add heroku-postgresql:standard-0 # standard-0 is the $50/mo database we want | |
heroku pg:wait # exits once the database is ready | |
heroku pg:info # figure out the new db's name… for this example it is HEROKU_POSTGRESQL_RED_URL, yours may differ | |
heroku pgbackups:transfer DATABASE_URL HEROKU_POSTGRESQL_RED_URL #copy all the data and enabled extensions | |
heroku pg:promote HEROKU_POSTGRESQL_RED_URL #make this db accessible via the DATABASE_URL name instead of this long but colorful one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment