If you have a large Piwik instance, upgrading to the latest Piwik version may take a long time (if one of the newest Piwik releases include database schema changes).

To upgrade your large Piwik instance, follow the manual three step procedure. This includes putting Piwik UI and Tracker in maintenance mode, and run the core:update command in the console. While Piwik Tracker is in maintenance mode, no data is being collected in the database. Therefore you may lose data for the few hours when Piwik was in maintenance.

This FAQ explains how to import the missing tracking requests in Piwik.

You have two options.

Option 1

During maintenance, visitors on your websites and mobile apps are still issuing the tracking requests. These piwik.php? tracking requests are stored in your Piwik server access logs files. Once the upgrade to the latest Piwik version is successful, you can create a new log file that contains all these piwik.php requests (for the time window that Piwik was in maintenance mode and not tracking).

Then you can replay this log file in Piwik which will backfill all your data: learn more in this FAQ.

Option 2

The second option requires the use of the QueuedTracking plugin with Redis.

  1. Install and setup QueuedTracking plugin.
  2. Enable writing requests into Redis
  3. Start Piwik upgrade
  4. Finish Piwik upgrade
  5. Process all requests from Redis into DB to backfill all your data (via ./console queuedtracking:process console command)
  6. Disable QueuedTracking plugin (Redis) again
  7. Piwik normal behavior resumes

If you have any feedback or suggestion, please leave a comment below.

Any questions?

Many answers and more information about Piwik You can find here:

We are social

Follow us: