Upgrading
How to move to a new server version, what to check first, how to roll back and how to move to another domain.
Upgrading the server
Every version is a tag in the repository. Changes and special steps of each version are in the changelog.
python3 tools/mvp-stack.py backup --backup /absolute/path/before-v0.2.5
git fetch --tags
git checkout v0.2.5
python3 tools/mvp-stack.py up
python3 tools/mvp-stack.py checkup rebuilds the images, applies database migrations (migrate) and starts the new server only
after they succeed. If a migration fails, the server does not start and the database stays on its
previous schema. Rebuild the web client too, if you have one.
Skipping versions is fine: migrations apply in order. The exception is federations older than
0.2.0 that kept their data in SQLite: release 0.2.0 converts them first (mvp-stack.py convert from
its checkout), and only then can they upgrade further.
Checking the data before an upgrade
After the git checkout of the new version, but before up:
python3 tools/mvp-stack.py preflightThe command builds the migrator of the new version and checks the database: whether the data will
pass the migrations (for example, no conflicts of public names and owners). Neither data nor schema
change. The federation server stops for the check, which refuses while it writes to the database,
and then starts again on the old version. up runs the same check before migrating and leaves the database alone on a
conflict.
Order with several processes
- Upgrade gateways before the primary server.
- Upgrade the SFU together with the server.
Required app updates
Some server versions do not work with old apps. Then the server raises the minimum app level, and an
outdated app shows the update screen with the link from --client-update-url
(app versions). The changelog marks such versions. People's data stays: after
updating, the app shows their earlier chats.
Rolling back
The database schema does not migrate backwards, and an old server will not start on a database
newer than itself. A rollback is restoring the backup taken before the upgrade, on the old version.
restore never touches existing volumes, so on the same machine the copy comes up as a separate
Docker project, after the upgraded stack is stopped:
python3 tools/mvp-stack.py stop --state .local/mvp
git checkout v0.2.4
python3 tools/mvp-stack.py restore --state .local/rollback --project comon-rollback --backup /absolute/path/before-v0.2.5
python3 tools/mvp-stack.py up --state .local/rollback --project comon-rollbackFrom then on pass --state .local/rollback --project comon-rollback to every command of that
stack. The stopped stack's volumes stay: delete them only once the rollback has proven itself.
Everything people wrote after the backup is lost in a rollback, and the
first start from a backup holds outbound work until
release-outbound.
Moving to another domain
A federation's identity is its ID and Noise key, not its domain: keep both.
- Point the new domain's DNS at the server and register the new redirect URI
https://<new domain>/auth/oidc/callbackwith the sign-in provider. Theissuerstays. - Route both domains to the server, the relay and the web client in the proxy.
- Start the server with
--public-originand--web-clientof the new domain: the federation document, link pages and sign-in start naming it. - Update the media addresses for the new domain:
calls.json,sfu.env, the TURN TLS certificate. - Leave the relay's entry in
federation-push.jsonunchanged: both domains lead to the same relay, and a device binding remembers its relay. - A web client on the new address needs its own
webpushsection inrelay.jsonand its ownweb.env. Browsers keep data per address, so web users sign in once more.
Apps that already added your federation remember the old address and keep going through it, so keep the old domain as an alias of the same federation. New sign-ins and call links go to the new domain. Only apps whose build has the new address as their default federation move by themselves.