Force update the Piwik database?


I think I skipped several updated :smiley:

I get the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘custom_var_k1’ in ‘field list’

When I try to update my piwik_log_visit table with the SQL code taken from the 1.2.php update file, I get the following error:
Unknown column ‘config_md5config’ in ‘piwik_log_visit’

So I’ve a question, is it possible to force update the piwik database schema, either through web or using the CLI? I try with module=CoreUpdater but it keeps redirecting me to the start page.


You might want to stick to releases in future.

We haven’t released 1.2 yet, so you’re evidently using the development trunk. In trunk, the update scripts are subject to change. You can’t force a schema update at this point. (And I wouldn’t recommend it given that your schema appears to be in some limbo state.)

You could try installing Piwik in a separate database, exporting the schema for both databases (using mysqldump --no-data), and then comparing them. Then refer to the SQL in the update scripts as a reference to migrate your existing database manually.

Ok, I’ll revert to a released version, you’re right.

Yes I’m using trunk, sorry I forgot to mention this.

If you revert to a released version, you’ll have to restore your database from a backup (or start fresh). config_md5config is not a new column – I suspect it was dropped during your SQL adventure.