Okt 222011
 

Recently I upgraded my Piwik version, but the update of the database failed (most likely, because I tried to access Piwik during the ftp-upload of the new version was still in progress. This caused Piwik to assume that the upgrade of the database was already successful although this did not happen.

So I needed to update the database manual. But what has changed since my last version? If you want to find information about this, you need to browse to the directory /piwik/core/Updates and open all php-files that contain a version number that is bigger than the version you had previously installed.

Now you have to extract all SQL-statements replace the piwik-table prefix and execute it in your database. Afterwards your update should work without any problems.

It would be nice feature if Piwik would support a “force-update” from version feature via the web-gui 😉

Here you can see the example for all necessary database updates from 1.5 to 1.6 🙂

ALTER TABLE piwik_log_conversion_item
ADD idaction_category2 INTEGER(10) UNSIGNED NOT NULL AFTER idaction_category,
ADD idaction_category3 INTEGER(10) UNSIGNED NOT NULL,
ADD idaction_category4 INTEGER(10) UNSIGNED NOT NULL,
ADD idaction_category5 INTEGER(10) UNSIGNED NOT NULL

ALTER TABLE piwik_log_visit
CHANGE custom_var_k1 custom_var_k1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k2 custom_var_k2 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v2 custom_var_v2 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k3 custom_var_k3 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v3 custom_var_v3 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k4 custom_var_k4 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v4 custom_var_v4 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k5 custom_var_k5 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v5 custom_var_v5 VARCHAR(200) DEFAULT NULL

ALTER TABLE piwik_log_conversion
CHANGE custom_var_k1 custom_var_k1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k2 custom_var_k2 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v2 custom_var_v2 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k3 custom_var_k3 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v3 custom_var_v3 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k4 custom_var_k4 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v4 custom_var_v4 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k5 custom_var_k5 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v5 custom_var_v5 VARCHAR(200) DEFAULT NULL

ALTER TABLE piwik_log_link_visit_action
CHANGE custom_var_k1 custom_var_k1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k2 custom_var_k2 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v2 custom_var_v2 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k3 custom_var_k3 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v3 custom_var_v3 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k4 custom_var_k4 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v4 custom_var_v4 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_k5 custom_var_k5 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v5 custom_var_v5 VARCHAR(200) DEFAULT NULL
  •  22. Oktober 2011
  •  Posted by at 11:32
  •   Kommentare deaktiviert für manual repair of Piwik database
  •   Allgemein