matomo-org/docker

Upgrade problem using docker clear

rusty1281 opened this issue · 11 comments

Hello,

I have a running version 3.13.3 using the latest tag image. When I try and upgrade to 3.13.5 image using clear, the container switches to a new image, but the version is still on .3. Checked the version.php file and also there is the notification on the dashboard saying the same.

Should this update be done via UI or am I doing something wrong? Why is the recreated container using the new image but still presenting the old version?

Thank you in advance for any info.

4ev commented

The same question?

Same here...

artm commented

The first time the container is run it copies the code to /var/www/html which is a persistent volume. That's the version of the application that is running. Whenever the container is restated it checks for a file /var/www/html/matomo.php and if it is present leaves the volume alone. Which means the container with a newer version of matomo will still run the old version of matomo. Upgrading via UI will update the code on the volume, but there "correct" upgrade order (first container than the application or other way around) and even the necessity to update the container altogether are undefined.

This happens because matomo's architecture is incompatible with stateless containers philosophy of traditional docker applications.

I had the same question:
In light of @artm's answer, what would be the way to go for a clean upgrade?

  1. upgrade via the web interface, then pull the new image and rebuild the container
  2. pull the new image, recreate the container, then upgrade via the web interface
  3. pull the new image, erase the volume altogether and rebuild it with a new container
  4. something else?

Just as a side note, I'm using Nextcloud, and they have a rather nice solution where, once the new image has been pulled and a new container is created, it checks whether there was an upgrade and triggers an update automatically if needed:
see (https://github.com/nextcloud/docker/blob/master/docker-entrypoint.sh#L87)

J0WI commented

What is "docker clear"?

@jdespraz answer 2 for me.

This is my upgrade process :

  1. docker-compose pull
  2. docker-compose down
  3. docker-compose up -d
  4. Database upgrade if requested
  5. Check Matomo version using this command docker-compose exec app printenv MATOMO_VERSION

Has worked until now. I'm still waiting for the release of version 3.14.1 of the Docker Matomo image. See #213.

jkjha commented

This is really very confusing. What should be the upgrade path for docker images? Matomo team, can you please create a documentation for this.

This is really very confusing. What should be the upgrade path for docker images? Matomo team, can you please create a documentation for this.

The way I ugrade.

  1. download the fresh docker image.
  2. run the "clean" process (destroy the old container and start a new one with the new image) or run "recreate" via portainer
  3. upgrade via Matomo UI
jkjha commented

yes above workes. Thanks @rusty1281

Here are detailed steps that I followed for my upgrade (My Mysql DB size is >90GB, so i prefer command line upgrade)

  1. Get the Mysql dump of the data (Will be needed only if something unexpected occurs).
  2. Download latest docker image and deploy it to your k8s cluster.
  3. Go to config/config.ini.php file and add maintenance_mode = 1 in [General] section.
  4. Add a new section in config file:
   [Tracker]
    record_statistics = 0
  1. Run console command: php console core:update

If all works fine, remove config that you did in step 3 and step 4 and check the UI. Your matomo should have been upgraded.

tholu commented

@davidlemaitre Have you successfully updated to Matomo 4 this way?

J0WI commented

duplicate of #248