Database Reference
In-Depth Information
Upgrade the database plan with follower
A follower database is also an interesting feature to upgrade the database plan with a small
amount of downtime.
This operation consists of adding a new follower database with the desired plan and then
promoting it to the main database of your application. The advantage of this solution is that
the downtime is very low, around 1 minute.
The first step is to create a new follower with the new plan to upgrade:
$ heroku addons:add heroku-postgresql:standard-2 --follow
DATABASE_URL --app your-app-name
Adding heroku-postgresql:standard-2 on your-app-name...
done, v247 ($200/mo)
Attached as HEROKU_POSTGRESQL_GOLD_URL
Follower will become available for read-only queries when
up-to-date
Use `heroku pg:wait` to track status.
Use `heroku addons:docs heroku-postgresql` to view
documentation.
The second step is about preventing new updates to the main database so that you can be
sure that both databases will be synchronized. This action consists of putting your applica-
tion in maintenance mode and disabling its processes:
$ heroku maintenance:on --app your-app-name
Enabling maintenance mode for your-app-name... done
Now, you should also disable your works to prevent any update of data from them:
$ heroku ps:scale worker=0 --app your-app-name
Scaling dynos... done, now running worker at 0:2X.
After that, you can check whether the follower database is already built through the her-
oku pg:wait command:
$ heroku pg:wait --app your-app-name
Search WWH ::




Custom Search