Upgrade Matomo

  1. Log in to the Matomo VM via SSH
  2. Edit (as root) the file /var/www/html/config/config.ini.php and add the lines below to temporarily disable Matomo tracking and disable the Matomo user interface and API. This will cause measuring requests to not be processed and tracked by Matomo, to speed up the upgrade:
    record_statistics = 0
    maintenance_mode = 1
  3. Run the following commands to make a backup of the config file, download the latest version of Matomo:
    cp /var/www/html/config/config.ini.php /tmp/config.ini.php # Copy the original config file
    wget https://builds.matomo.org/matomo.zip -P /tmp # Download the latest Matomo version
    unzip -o /tmp/matomo.zip -d /tmp/matomo # Unzip the Matomo archive
    sudo cp -r /tmp/matomo/matomo/* /var/www/html/ # To copy the unzipped archive to the Matomo installation directory
  4. Run the following command to perform any database upgrade: sudo /var/www/html/console core:update
  5. Remove the added values from step 2.
  6. Perform the Matomo system check to determine if there’s any issue that should be fixed
  7. Clean-up the results from step 3 by executing:
    rm /tmp/matomo.zip # delete the archive and read below the next step
    rm /tmp/config.ini.php # delete the backup config file
    rm -r /tmp/matomo