8000 Document how to Upgrade Piwik without losing any tracking data · Issue #9186 · matomo-org/matomo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Document how to Upgrade Piwik without losing any tracking data #9186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alex-rowe opened this issue Nov 8, 2015 · 4 comments
Closed

Document how to Upgrade Piwik without losing any tracking data #9186

alex-rowe opened this issue Nov 8, 2015 · 4 comments
Labels
c: Website matomo.org For issues related to our matomo.org website.
Milestone

Comments

@alex-rowe
Copy link

Hi all,

It would be great if using the command line upgrade or the web upgrade would automatically replay the logs for you once complete.

Currently there is no easy way to do this as it requires somehow finding the correct "piwik.php" requests in a very large Apache log file and then importing them using the python import file.

If there was a config option to redirect logs or similar, so that when it comes to the shouldRecordStatistics() function in core\Tracker.php it is able to divert or create a special log file in the /tmp dir, that file could then be imported once the upgrade has been completed without losing any tracking information.

Are there any plans to reconfigure how upgrades work so that larger installations can update more easily?

Thanks
Alex

@tsteur
Copy link
Member
tsteur commented Nov 9, 2015

The logs itself are written by your webserver, eg apache. There could be maybe a script that gets all requests between upgrade start and upgrade end and then replaying these logs.

The last upgrades did not include any schema changes so the updates should have taken only a few seconds but it obviously depends on the setup etc. Also there might be upgrades that take longer in the future and there might be plugins that take a long time when installing them (eg the new plugin CustomDimensions will take a long time when installing it via Marketplace).

There is a plugin QueuedTracking that writes all requests into a queue similar to how you described but it would do it all the time, even when you are not upgrading.

@alex-rowe
Copy link
Author

Hi @tsteur

I was thinking more along the lines of a custom log file just for piwik.php, as the Apache access file contains all page hits for the Piwik website.

We're trying to come up with a solution where an upgrade can be completed where no requests will be dropped, as we track all visits with userid and a custom variable to map a user's actions through our sites.

If we use the Redis plugin, I imagine we can stop the queue processing, upgrade the site then re-enable the queue processing, that will then pick up and slowly process all hits during the upgrade process? Are there issues when uploading new versions of the plugin/piwik and there being a time where the upgrade has not completed so it will not track requests?

8000

@tsteur
Copy link
Member
tsteur commented Nov 9, 2015

It should work with the Redis plugin but I haven't tested it.

Basically you could:

  1. Enable writing requests into redis
  2. Start upgrade
  3. Finish upgrade
  4. Process all requests from redis into DB
  5. disable queued tracking (Redis) again
  6. Use normal tracking behaviour

@mattab
Copy link
Member
mattab commented Nov 25, 2015

We have this FAQ: How do I upgrade a large Piwik instance without losing any tracking data?

I've just added in the FAQ the following:

Option 2

The second option requires the use of the [QueuedTracking plugin][4] 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 (backfill all your data)
  6. Disable QueuedTracking plugin (Redis) again
  7. Piwik normal behavior resumes

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

--> marking as closed as it's now documented. if there is any problem or question ask here or in the FAQ comment box

@mattab mattab closed this as completed Nov 25, 2015
@mattab mattab changed the title Allow Upgrade to replay logs automatically Document how to Upgrade Piwik without losing any tracking data Jan 29, 2016
@mattab mattab added this to the 2.16.0 milestone Jan 29, 2016
@mattab mattab added the c: Website matomo.org For issues related to our matomo.org website. label Jan 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Website matomo.org For issues related to our matomo.org website.
Development

No branches or pull requests

3 participants
0