Upgrading#
How an Empowerment Center installation is moved to a new version, what happens to the own database, how to go back if needed and how to keep third-party images up to date with their security patches.
Before you start#
- Read the release notes of the new version: they may ask for something before upgrading (a database extension, a new variable).
- Choose a time without use: jobs in progress are lost and scheduled tasks that are running are treated as interrupted.
- Have the new images at hand, for the backend and the frontend, of the same version: they are always updated together.
Migrations only go forward#
On startup, the new backend updates the schema of the own database (its migrations) before serving anyone. Those migrations only go forward:
- an earlier version does not start on an already migrated database;
- going back means restoring the backup from before the upgrade with the earlier images.
That is why the first step is always the backup. With the own database in Oracle, even more so: there a migration that fails halfway is not undone (see With the own database in Oracle).
Upgrade with Docker Compose#
-
Back up the own database and check that the file is not empty (see Backup and restore):
-
Get the new images. If they come from a registry, change the tag in
deploy/.env(ECENTER_BACKEND_IMAGEandECENTER_FRONTEND_IMAGE) and pull them; if you build them, use the new sources: -
Also replace
deploy/compose.yamlwith the new version's one, if it brings changes (for example, another pinned version of Chromium or PostGIS), keeping your.envand your ownapplication.yml. -
Start:
Compose stops the old backend (with 45 s to finish in an orderly way), starts the new one, which applies the migrations, and then serves.
-
Check the version at
https://ecenter.example.org/api/aboutand in Administration › Operations › Summary, and that there are no new alerts.
What carries on and what does not:
| What | After upgrading |
|---|---|
| Users' sessions | They carry on: they are in the own database. On reloading, the browser loads the new web application. |
| Jobs in progress and their results | They are lost: users calculate again. |
| Scheduled tasks running | They are treated as interrupted and stay that way in their history. |
| Kept data of cubes | If the new version calculates differently, each affected document is calculated once, when opened or at its next scheduled recalculation. |
Note
The first time a new version starts it may re-index what workbooks and portal publications use. Meanwhile, usage searches are somewhat slower, but complete.
With several instances#
Stop all instances before starting the first new one. An old instance does not understand the migrated database and could save data the new one cannot read.
- Make the backup.
- Stop all backends.
- Start a new one and wait for it to be healthy (it has migrated the database).
- Start the others.
Without containers#
- Back up the own database.
- Stop the backend service.
- Replace the jar with the new one and the web application files with the new ones.
- Start the service and follow its log until it serves.
With the own database in Oracle#
Upgrading is the same: the backup, the new images or jar, and starting. The new backend applies the Oracle migrations on startup. Two things change:
- The backup before upgrading is made with the Oracle tools (RMAN or Data Pump), not with
pg_dump(see Backup and restore). - A migration that fails halfway is not undone. In Oracle, each statement that changes the structure (DDL) is committed by itself: if a migration fails in the middle, what it already did stays done.
Warning
With the own database in Oracle, the backup before upgrading is not optional. If a migration fails, stop the backend, restore that backup and tell Action Ware. To keep working meanwhile, go back to the earlier version as described in Going back.
Going back#
If something goes wrong and you have to return to the earlier version:
- Stop the backend.
- Restore the backup from before the upgrade (see Restore the own database; with the own database in Oracle, with the Oracle tools).
- Put back in
deploy/.envthe tags of the earlier images (and the earliercompose.yaml, if you changed it). - Start:
docker compose -f deploy/compose.yaml up -d.
What was done between the upgrade and going back is lost.
Pinned images#
Third-party images (PostGIS, Chromium, Valhalla and the bases of the ECenter images) are pinned by their digest, with the tag in front so it can be read:
That way, a tag that someone publishes again does not change what is installed without your deciding it. But pinned is not patched: with the digest, restarting does not pick up the security patches published later under the same tag.
Every month, and before upgrading ECenter, review the third-party images of deploy/compose.yaml:
-
Look at the current digest of the same tag:
The
Digest:line is that of the image for all its platforms. -
If it has changed, replace the digest in
deploy/compose.yamland restart that service. -
Check that everything still works.
| Image | How often it usually has patches |
|---|---|
postgis/postgis (and its PostgreSQL) |
With each minor version of PostgreSQL. |
chromedp/headless-shell |
Every few weeks: it loads the base map from outside. |
ghcr.io/valhalla/valhalla-scripted |
With each version of Valhalla. |
The ECenter images (backend and frontend) are updated by Action Ware with each version, with their JRE, their nginx and their dependencies up to date. Do not change their digest on your own.
Important
Do not change the major version of PostgreSQL (from 18 to another) by changing the image tag: the data of one major version cannot be read with another. That requires a PostgreSQL migration (pg_upgrade or backup and restore) and that ECenter supports that version.
If the database user is a superuser#
With the deploy/compose.yaml of the preview versions of ECenter 8, the ecenter user of the own database was the image's superuser. The init script does not run again on a volume that already exists, so it stays that way and works, but it is advisable to remove it. It is the user with which the image created the database, and PostgreSQL does not let you remove its superuser attribute (“The bootstrap superuser must have the SUPERUSER attribute”): the database is moved to a new volume with a backup.
-
Make a backup with
ecenter, which in that installation is the superuser, and also keep it off the server: -
Stop the installation, without deleting its volumes, and delete only the database one:
-
Start only the database. When it is created again,
ecenteris its owner without being a superuser andpostgreshas no password: -
Restore the backup as in Backup and restore (steps 2 and 3, with
ecenter-antes.dump) and start the rest withdocker compose -f deploy/compose.yaml up -d.
From then on, make the backups with postgres, as in Backup and restore.