Site Overlay

Upgrading Tryton Docker Stacks

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)

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.

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):

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:

Step 3: Pull the 7.2 Docker image

We first stop any Docker container of the 7.0 Tryton stack:

Then edit the .env file of the Docker stack to bump the version tag from 7.0 to 7.2:

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.

Finally we have to replace our Tryton 7.0 desktop client against a Tryton 7.2 client.