Step 1: Make volume backups
As the upgrade procedure (potentially) involves modifications on the database, it is recommended to backup the Docker volumes of our Tryton stack. We therefore use the loomchild/backup Docker. In my case, there are two Docker volumes dedicated to Tryton:
tryton_data
(which is an empty volume)tryton_db
(which holds anything related to the PostgreSQL database)
1 2 3 4 |
docker run -v tryton_db:/volume --rm --log-driver none loomchild/volume-backup backup - > tryton/tryton_db.tar.bz2 docker run -v tryton_data:/volume --rm --log-driver none loomchild/volume-backup backup - > tryton/tryton_data.tar.bz2 |
Step 2: Manual preparations in the existing database
The Tryton database documentation recommends to check the release migration page if there are manual preparations to perform prior to the upgrade. Indeed the record for version 7.2 shows a couple of SQL commands to use NULL values instead of empty foreign keys.
1 2 |
ilek@i5:~/docker/tryton$ docker compose up --detach postgres ilek@i5:~/docker/tryton$ docker exec -it tryton-postgres-1 bash |
Now inside the container connect to the psql
prompt (assuming our Tryton database has the name tryton_db
and the dedicated Tryton database user has the name tryton_db_user
):
1 |
root@b2dc5b761016:/# psql -d tryton_db -U tryton_db_user |
Now we can perform the manual preparations as shown on the release migration page (we can copy and paste the complete block of commands and execute it in one shot). Before updating from Tryton 7.0 to Tryton 7.2:
1 2 3 4 5 6 |
tryton_db=# UPDATE "ir_ui_view" SET "model" = NULL WHERE "model" = ''; UPDATE "ir_action_act_window" SET "res_model" = NULL WHERE "res_model" = ''; UPDATE "ir_action_wizard" SET "model" = NULL WHERE "model" = ''; UPDATE "ir_action_report" SET "model" = NULL WHERE "model" = ''; UPDATE "ir_action_report" SET "module" = NULL WHERE "module" = ''; UPDATE "ir_translation" SET "module" = NULL WHERE "module" = ''; |
Step 3: Pull the 7.2 Docker image
We first stop any Docker container of the 7.0 Tryton stack:
1 |
ilek@i5:~/docker/tryton$ docker compose down |
Then edit the .env file of the Docker stack to bump the version tag from 7.0 to 7.2:
1 2 3 4 5 6 |
TRYTON_TAG=<strong>7.2</strong> POSTGRES_VERSION=16 POSTGRES_DB=tryton_db POSTGRES_USER=tryton_db_user POSTGRES_PASSWORD=<removed> EMAIL_FROM=<removed> |
To be on the safe side we check with docker ps -a
if there are any “stale” Tryton containers which have just been stopped but not removed. If so, we remove them with docker container rm ...
Now we are ready to relaunch our 7.2 Tryton stack. If all went according to plan, Docker should start with pulling the new image.
1 |
ilek@i5:~/docker/tryton$ docker compose up -d |
Finally we have to replace our Tryton 7.0 desktop client against a Tryton 7.2 client.
1 2 |
ilek@i5:~/docker/tryton$ flatpak remove org.tryton.Tryton-70 ilek@i5:~/docker/tryton$ sudo flatpak install flathub org.tryton.Tryton-72 |