docker icon indicating copy to clipboard operation
docker copied to clipboard

Upgrade problem using docker clear

Open rusty1281 opened this issue 4 years ago • 10 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.

rusty1281 avatar May 05 '20 09:05 rusty1281

The same question?

4ev avatar May 06 '20 12:05 4ev

Same here...

customizeXF avatar May 06 '20 13:05 customizeXF

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.

artm avatar May 18 '20 08:05 artm

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)

j-zarp avatar Jun 05 '20 12:06 j-zarp

What is "docker clear"?

J0WI avatar Sep 12 '20 14:09 J0WI

@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 https://github.com/matomo-org/docker/issues/213.

davidlemaitre avatar Sep 17 '20 13:09 davidlemaitre

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

jkjha avatar Jan 05 '21 11:01 jkjha

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

rusty1281 avatar Jan 05 '21 11:01 rusty1281

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.

jkjha avatar Jan 06 '21 06:01 jkjha

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

tholu avatar Jan 20 '21 13:01 tholu

duplicate of https://github.com/matomo-org/docker/issues/248

J0WI avatar Nov 26 '22 15:11 J0WI