Upgrade from 4 to 5 gone wrong

Hello!

I currently use DDEV to run Matomo locally so that I can run upgrades locally to make sure everything goes OK and then check in the changes and push them up to my repo and the pull the changes to the live server. I thought this would work well but in the last upgrade from 4 to 5 it worked perfectly on my local system and updated the DB to v5, but when I pulled all of the updated files up to the server, the production site is now giving 500 server error. When I looked at the error logs I saw the message:

Fatal error : Uncaught Error: Failed opening required ‘/var/www/vhosts/analytics/vendor/composer/…/symfony/polyfill-php80/bootstrap.php’ (include_path=‘/var/www/vhosts/analytics/vendor/pear/pear_exception:/var/www/vhosts/analytics/vendor/pear/console_getopt:/var/www/vhosts/analytics/vendor/pear/pear-core-minimal/src:/var/www/vhosts/analytics/vendor/pear/archive_tar:.:/usr/share/php’) in /var/www/vhosts/analytics/vendor/composer/autoload_real.php:43 Stack trace: #0 /var/www/vhosts/analytics/vendor/composer/autoload_real.php(47): {closure}() #1 /var/www/vhosts/analytics/vendor/autoload.php(25): ComposerAutoloaderInit7af8579462ad6955997d761e29598959::getLoader() #2 /var/www/vhosts/analytics/core/bootstrap.php(44): require_once(‘…’) #3 /var/www/vhosts/analytics/index.php(19): require_once(‘…’) #4 {main} thrown in /var/www/vhosts/analytics/vendor/composer/autoload_real.php on line 43

Sorry, I am a Matomo newbie, just looking for some possible direction on how to fix.

So the solution was to download the latest Matomo onto the server and go through the setup again… I was able to use the existing DB so all was restored and now on the latest version. Pretty easy fix, but I now believe I should not be doing upgrades locally then pushing them up, I don’t think this is setup that way and there are environment variables to consider so I’m now going to just do a backup and run the upgrade through the UI on the live site.

1 Like