Upgrading from 0.8.2.1 to 0.9.0¶
First, read CHANGELOG.md to get familiar with the new release.
You must read the entirety of this document before starting the upgrade.
Check replication status¶
During the upgrade CockroachDB will be running with one less node than usual. Check now to make sure you have enough nodes in your pool to carry out the upgrade and maintain availability.
Pick a lead node¶
Pick one of your Hot Potato nodes to ‘lead’ the upgrade. This node will carry out database migrations while the other nodes respond to notifications on the old version.
Copy the database¶
On your lead node create a copy of your database to do the upgrade on. See the cockroach docs for how to do this.
Upgrade host and/or python version¶
If Hot Potato was running on Xenial, now is an ideal time to upgrade to Bionic. Hot Potato 0.9.0 moves the officially supported Python version to 3.6. Alternatively you can use unofficial builds or backports if an upgrade is not feasible.
Upgrade the lead node¶
Stop Hot Potato on your lead node.
Deploy the new Hot Potato code.
Update dependencies with Pipenv.
$ pipenv sync
Update the configuration file to point at the correct (to upgrade) database
Add method and provider settings to the config:
[MODICA] ENABLED = true ... [TWILIO] ENABLED = true ... [PUSHOVER] ENABLED = true ... [SMS] ENABLED = true [PAGER] ENABLED = true [APP] ENABLED = true
Update the database URL in the config file:
Before:
[SQLALCHEMY] DATABASE_URI=cockroachdb://user:pass@server:port/database
After:
[COCKROACH] SERVER=server PORT=port DATABASE=database USERNAME=user PASSWORD=pass
Install npm
In
theme/
runnpm install --production
to install front-end dependenciesIn
theme/
runNODE_ENV=production npm run build
to build front-end dependenciesRun migrations:
$ FLASK_APP=app/app.py flask db upgrade
This may take a long time depending on the size of your database.
Check the migration succeeded, and the database is in a good state
Stop Hot Potato (NOT CockroachDB) on all other nodes and start Hot Potato on the lead node. Consider using Anycast to eliminate service unavailability during this period.
Upgrade all other nodes¶
Stop Hot Potato
Check out the new code
Update dependencies with Pipenv
Update the configuration file
Install npm and build the front-end dependencies
Start Hot Potato
Catch up the database¶
If necessary, update the new database with changes made during the upgrade. Currently this must be done manually.