matomo-org / docker

Official Docker project for Matomo Analytics
https://matomo.org
Other
810 stars 343 forks source link

How to update? #248

Open michaelr524 opened 2 years ago

michaelr524 commented 2 years ago

I've updated from the web UI as it offered. But is this the right way? How should an update be completed with docker-compose? (I'm using the nginx example)

holzfelix commented 2 years ago

I tried the update via the docker-compose. Changed Version. But UI still shows Version 3.4.1

michaelr524 commented 2 years ago

Yep. Had the same issue.

holzfelix commented 2 years ago

Found the solution, go on settings, on top of the screen you find an button, search for updates.

michaelr524 commented 2 years ago

Yeah @holzfelix that's what I meant that I updated from the web UI. Just asking if it's the right way or we should update it by pulling latest versions of the repo and rebuilding the docker images somehow.

holzfelix commented 2 years ago

yes thats the correct way of upgrading.

Tideri-Tim2 commented 2 years ago

Yep. Had the same issue.

I have the same issue too. Dockerfile updated, new image pulled and container started. But the UI shows the old version. How come? Is there some kind of cache I have to clear? Log out and in again did not help. Thanks.

holzfelix commented 2 years ago

you have to click on update manually

holzfelix commented 2 years ago

klick on settings -> you have to click on the "Search for new versions" button image

Tideri-Tim2 commented 2 years ago

Thanks for your answer. I'm running Matomo on a Kubernetes system with a persistant-volume. So I guess I have to do both. Dockerfile-Update and the automatical file update like you are showing it now. Thanks for your help!

holzfelix commented 2 years ago

yes you have to do both.

codedmonkey commented 2 years ago

I don't see any buttons to search for updates. I just get a prompt "New update: 4.5.0" which is already the version of the Docker image. I'm guessing it's getting the current version from the database so how do I check if it needs to perform any database migrations?

Looks like this is a known issue: https://github.com/matomo-org/docker/issues/161

evesinger commented 2 years ago

can somebody please explain how they would do the upgrade, from let's say 4.6.2->4.10.1 in this scenario:

cause what I am doing is when I deploy the new docker image in ECS, I get to the setup screen again but then the step to connect to the DB fails with 'ACCESS DENIED' for any newer version than 4.6.2.

Is the proposed suggestion now to

Why would that be necessary...and why do I get 'Access Denied' message? seems strange to me.

psi-4ward commented 1 year ago

So I did an update right now.... and ... it was wired.

  1. /var/www/html is a volume https://github.com/matomo-org/docker/blob/master/Dockerfile-alpine.template#L89 so created a new container from an updated image still uses the old volume
  2. The entrypoint.sh Script checks if theres already a matomo.php and if not, it will copy the files from docker-image.

So what I did is just delete the volume, recreated the container and execute ./console core:update Ie docker inspect matomo => find the volume and do a docker volume rm ......

Never seen such a strange implementation of a docker image.

J0WI commented 1 year ago

This is somewhat blocked by https://github.com/matomo-org/matomo/issues/19151

JanMalte commented 1 year ago

This is somewhat blocked by matomo-org/matomo#19151

Could you explain how the linked issue is related to provide a simple docker based update process. I can‘t see how this should solve the issue with the mounted Matomo source volume.

J0WI commented 1 year ago

You need to update sources, optionally plugins, and then migrate the database. If you just update the source volume you may overwrite your configs or plugins. core:update can only migrate the database of existing installations but is useless if you start with a new installation or migrate your data and config to the new version. There might be workarounds but I'd prefer to wait for a stable CLI from upstream that I can use.

cma-se commented 1 year ago

My current solution is: I build the docker container as usual. So I have the new version under /usr/src. As the entry point prevent the use of the new version because it checks if the matomo.php is in the persistent volume. I attach a session to the running container and just execute the same commands like the entry point will do (cp from /usr/src and change owner) I think this is only a workaround but I can't use the webupdater. Maybe I will use an updater container which has a different entry-point. Did anyone see a problem in this approach?

routmoute commented 1 year ago

Simply remove matomo.php and restart the container with a new Matomo image works well for me.

exetico commented 1 year ago

I totally agree here. It's odd that Matomo doesn't really handle this as well, compared to other container images. A pull of the image(s) and a restart of the container, should indeed secure the newest version, if you ask me.

I've noted the tip from routmounte, so I'm currently execuing:

docker pull matomo && \
docker exec -it matomo-app-1 rm /var/www/html/matomo.php && \
docker restart matomo-app-1

(edit the context for docker-compose, or whatever you'd like)

Which did the trick for me...

I guess it would be better to remove the volume as noted in this issue, and using the ./console core:update, but... I'm sticking to this right now.

FuckingToasters commented 7 months ago

You should eb able to update it like any other docker image (make sure you use :latest tag in the image section of your compose file and then just redeploy it whenever there is a new version) alternativly you can use something like https://containrrr.dev/watchtower/ to automaate the update process for multiple running containers.