Update Piwik and import missing logs

I am looking to upgrade our Piwik install to 2.15 from 2.14.3 but would like to retain the tracking information lost when we disable tracking prior to the upgrade.

From the docs and faqs I can see that the procedure is

[li] Add “record_statistics = 0” to the config.ini.php file
[/li][li] Add “maintenance_mode = 1” to the above file
[/li][li] Update Piwik files and copy over the config file
[/li][li] Run “./path/to/piwik/console core:update”
[/li][li] Re-enable tracking and then replay Piwik server access logs

The last part is the bit that needs a bit more clarification, I have run a few tests where I disable tracking and check the logs, but there is no way to determine exactly when I need to start importing from. All FAQ_20844 mentions is to “create a new log file that contains the piwik.php requests for the time window that Piwik was in maintenance mode and not tracking”.

What is the best way to complete this? All I have come up with is maybe doing a “sed -i” on the config file and then echo’ing to the access log if successful, but it is not a very clean solution. Also, do you need to strip out all requests other than the piwik.php ones or will it just skip over them.

Is anyone else able to let me know how they have been updating in the past? Ideally, for larger institutions this should all be managed in Piwik itself as part of the upgrade step. E.g. during the upgrade forward all tracking data to a file in the /tmp dir and once upgraded, replay that file for you.


Hi Alex,

Thats a good question. If you manage to create a set of short instructions, I’d love to add them to the FAQ to help other users. Please let me know!