@anonymous-piwik-user opened this Issue on May 11th 2011

The Core Updater routine fails when updating to 1.4.0 if Visitor Tracking is not turned off.

Right now, the upgrade documentation only "recommends" that it be turned off, not "requires".

Steps to Reproduce

Run the third SQL statement in core\Updates\1.4-rc2.php, which is something along the lines of

UPDATE log_visit
SET location_ip = UNHEX(LPAD(HEX(CONVERT(location_ip, UNSIGNED)), 8, '0'))

When your log_visit table has both untranslated (i.e. 1.3.x) and newly entered location_ip values. The new (1.4.0 valid) location location_ip values will convert to an invalid hex integer, and the database will stop with this error message:

SQLSTATE[HY000]: General error: 1292 Truncated incorrect INTEGER value: ' ( '

Possible Fixes

Force the user to disable visitor tracking while DB migraitons occur


use this SQL statement instead

UPDATE piwik_log_visit
SET location_ip = UNHEX(LPAD(HEX(CONVERT(location_ip, UNSIGNED)), 8, '0'))
WHERE LENGTH(location_ip) > 4;

(which is what I used to manually complete my Piwik upgrade process, after manually changing my piwik_option version_core value as well.)

@robocoder commented on May 11th 2011 Contributor

Thanks. Already fixed in trunk.

This Issue was closed on May 11th 2011
Powered by GitHub Issue Mirror