Skip to content

Instantly share code, notes, and snippets.

@techieshark
Created November 6, 2014 06:40
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 techieshark/27b6c2259c9e832656ba to your computer and use it in GitHub Desktop.
Save techieshark/27b6c2259c9e832656ba to your computer and use it in GitHub Desktop.
switch heroku db
# 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