Upgrade problem: "Class 'Piwik_Plugin' not found"

Hi all, sorry for bothering you with sth that is clearly a case of rtfm-and-do-what-it-says.

An upgrade on a previous server failed because of an insufficent PHP version.
This happened inmidst of upgrading V2.0-rc1 to V3.7.0.

Now, I tried moving all files in piwikstats/* and the database to a new, more adequate server (running PHP 7.3).

There, running

console core:update

did, finally, update the Database, but then crashed with the message

Uncaught exception: Class ‘Piwik_Plugin’ not found
in …/piwikstats/plugins/DoNotTrack/DoNotTrack.php line 20

Can someone suggest further steps?

Thanks a lot!
Felix

Hi,

Maybe not all files did get replaced during the update. Try to replace all files with the latest version:
https://matomo.org/docs/update/#the-manual-three-step-update

Thanks, Lukas. I did as advised, using unzip -o. I checked that some files under plugins/ were effectively overwritten. Also, the console output now reports updating to version 3.13.0 (not 3.7.0 as previously).
But even though all this looks promising, the same message reappears: Uncaught exception: Error: Class ‘Piwik_Plugin’ not found.
According to the Stack Trace, core/Plugin/Manager.php was run, which contains the line “use Piwik\Plugin;”. The file “core/Plugin.php” also exists, which seems to define the Plugin class.
Can you help me look into something else? Would it be safe to unzip the latest release into a folder named ‘matomo’ (not overwriting the existing ‘piwikstats’, like I did), then recreate config.ini.php, then call console core:update?
Again, thanks a lot,
Felix

Hi,

It might be possible that there are files too much that are breaking everything. You might be possible to run the integrity checker with something like sudo -u www-data php7.3 console diagnostics:run.

Or as you suggested create a new directory with the latest files and just move over the config.ini.php. You won’t loose much (apart from installed plugins and things like geoip databases and custom logos).

Hi Lukas,
reinstalling proved to be easy as π. I only had to copy config/config.ini.php from the old installation and to re-chmod all subfolders and their content to www-data:www-data.
Thanks also for the hint about diagnostics:run; it produced a long list of files and folders to delete, but even after deleting, my problem persisted.
Cool to see upgrading over version gaps such as this one can be so easy.
Thanks again,
Felix

1 Like