go to heroku.com the site you are upgrading
-
add the new database - we chose 'CRANE' for 50$ / month
heroku addons:add heroku-postgresql:crane -
in console
heroku pg:wait --remote staging gives you a COLOR and tells you when new db is available -
stop app from creating new data
we used a json response in JsonController heroku recommends heroku maintenance:on --remote staging heroku ps:scale worker=0 --remote staging -
back up the current db
heroku pgbackups:capture --expire --remote staging dump it to local just in case $ curl -o latest.dump `heroku pgbackups:url --remote staging` -
restore the new db with the old databse data
heroku pgbackups:restore HEROKU_POSTGRESQL_OLIVE --remote staging --confirm dbappdev leave off --confirm dbappdev and confirm at prompt 'dbappdev' -
promote the new db to main db
heroku pg:promote HEROKU_POSTGRESQL_OLIVE --remote staging -
check that heroku has correctly assigned DATABASE_URL
heroku pg:info --remote staging you will see (DATABASE_URL) next to the name of the new db -
reacivate the application
heroku ps:scale worker=1 --remote staging heroku maintenance:off --remote staging re-commit code without JsonController down_for_maintenance -
delete the old database when convenient
heroku addons:remove HEROKU_POSTGRESQL_COPPER --remote staging
here was the quick production list ... took 1-minute
gphm
heroku ps:scale worker=0 --remote heroku
heroku pgbackups:capture --expire --remote heroku
curl -o latest.dump
heroku pgbackups:url --remote herokuheroku pgbackups:restore HEROKU_POSTGRESQL_<!!HEROKU-COLOR> --remote heroku --confirm <!!SITE_NAME>
heroku pg:promote HEROKU_POSTGRESQL_<!!HEROKU-COLOR> --remote heroku
heroku pg:info --remote heroku
heroku ps:scale worker=1 --remote heroku
gphm