Islandora-Devops / isle-dc

ISLE 8 - Dockerized Islandora 8 Deployment orchestrated with docker-compose
MIT License
23 stars 60 forks source link

Matomo docker volume causes issues when upgrading Matomo's version #361

Closed joshdentremont closed 4 months ago

joshdentremont commented 1 year ago

The way that the volume for Matomo is configured causes it to block updates when you move to a new version of Buildkit that has a newer version of Matomo. There have been a few suggestions on how to deal with this issue here (https://github.com/Islandora-Devops/isle-dc/issues/356)

I don't use Matomo, so I don't know the best way to deal with this, but it should probably be addressed by either changing the way the volume is mounted so that upgrading doesn't cause issues, or given a workaround for upgrading in the instructions here (https://github.com/Islandora/documentation/pull/2264)

This will also likely be an issue in the site template, because it looks like the volume mount is the same, so whatever we do, we should do there too.

joshdentremont commented 10 months ago

Following Gavin's instructions at https://github.com/Islandora-Devops/isle-dc/issues/356#issuecomment-1739488817 I was able to update my matomo. These are the steps that worked for me:

docker compose cp matomo:/var/www/matomo/config/config.ini.php ~/Desktop
make down
change matomo volume location from /var/www/matomo to /var/www/matomo/config in build/docker-compose/docker-compose.matomo.yml
docker volume rm {COMPOSE_PROJECT_NAME}_matomo-config-data
make -B docker-compose.yml
make up
docker compose cp ~/Desktop/config.ini.php matomo:/var/www/matomo/config/
docker compose exec matomo chown nginx:nginx /var/www/matomo/config/config.ini.php
make down
make up
go to https://islandora.traefik.me/matomo/ and click upgrade matomo at the bottom 

image

I have not used Matomo, so I have no tracking data. This should not be destructive to existing data, but it would be good if someone with Matomo data who is running Buildkit 1.x could test these instructions as well.

Changing the location of the volume is not necessary for this upgrade, but it should make it so future upgrades don't require doing these steps

joshdentremont commented 10 months ago

This may no longer be an issue once the following PRs go through: https://github.com/Islandora-Devops/isle-buildkit/pull/306 https://github.com/Islandora/documentation/pull/2271

Changing the volume location in isle-dc is a little more involved than in site template. It would be nice if new sites in isle-dc were created with the new volume location as well, but anyone with an existing site would need to follow the instructions above to change their existing volume.

I'm hoping to discuss this at the tech call next week.

joshdentremont commented 10 months ago

It looks like the way we are mounting the volume is the recommended way: https://hub.docker.com/_/matomo

There are several suggestions at https://github.com/matomo-org/docker/issues/248 on how to go about this. I think we need to make sure that nothing is lost from the volume when we upgrade, so it might have to be done through the web UI, or by only deleting matomo.php.

I think this needs to be tested by setting up a new site on 1.0.10, setting up matomo so we get some data in the database, and installing plugins. Then we should try updating to 2.0.10 and see if we can update matomo via the web UI without losing the existing data.

If that works, it should probably be documented here: https://islandora.github.io/documentation/installation/docker-maintain-isle/

joshdentremont commented 4 months ago

Given that we are going to remove Matomo from site template and isle-dc I think we can close this.

https://github.com/Islandora-Devops/isle-site-template/issues/41