Zum Inhalt

Piwik Upgrade from version 2 to 3 fails due to MySQL problems

If you want to upgrade your existing Piwik 2 installation to Piwik 3 you might run into different error messages during this process which will prevent you from performing the upgrade. This is caused by a missing table and a missing column in the existing database. Here is an example how to solve the problems based on a Piwik 2 Installation on Plesk 17. Please be sure to backup your database before performing any manual operations.

The first error you get is:

Kritischer Fehler während der Aktualisierung:
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‚piwik_d.plugin_setting‘ doesn’t exist

This can be resolved by performing the following SQL query manually:

CREATE TABLE plugin_setting (
plugin_name VARCHAR(60) NOT NULL,
setting_name VARCHAR(255) NOT NULL,
setting_value LONGTEXT NOT NULL,
user_login VARCHAR(100) NOT NULL DEFAULT '',
INDEX(plugin_name, user_login)
) ENGINE=Innodb DEFAULT CHARSET=utf8

If you trigger the upgrade process again you might run into a second problem:

Kritischer Fehler während der Aktualisierung:
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‚plugin_name‘ in ‚where clause‘

You can resolve this issue by dropping the table site_settings and create it completely new:

CREATE TABLE site_setting (
idsite INTEGER(10) UNSIGNED NOT NULL,
plugin_name VARCHAR(60) NOT NULL,
setting_name VARCHAR(255) NOT NULL,
setting_value LONGTEXT NOT NULL,
INDEX(idsite, plugin_name)
) ENGINE=INNODB DEFAULT CHARSET=utf8

In my case there was no data in this table so if you have data in it, don’t drop this table but try to add the column plugin_name manually.

After that the Piwik Upgrade should run through and you can use version 3 now.

Published inHow-ToSoftware

Schreibe den ersten Kommentar

Schreibe einen Kommentar