Using Queued Tracking for server migration?

I am planning to migrate our Matomo installation to a new server. But I need to have a solution to continue tracking users during the process. I have seen the plugin Queued Tracking, which would be useful for that. Here’s what I plan to do. Could someone tell if it seems correct ?

  1. Install Queued Tracking, activate it
  2. Disable the “Process during tracking request”
  3. Copy Matomo and Mysql tables to new server
  4. Modify DNS
  5. Once all requests are sent to new server, copy the contents of the tables “queuedtracking_list_*” from old to new server
  6. Set a cronjob on new server to process the queue every minute and import all data since step 2.
  7. Keep it like that or disable “Process during tracking request”

I fear that there might be some auto-increment index causing problem at step 5., and don’t know if there is a solution for that…

I see also the Migration plugin, but it is not very clear how to use it in this situation. And it is still in beta.


In theory this sounds like it should work, but I don’t have enough experience with server migrations so I might miss something important.

Another way would be recording the access.log of the Matomo server (so the piwik.php?something requests) and replaying them using log analytics afterwards:

How do I upgrade a large Piwik instance without losing any tracking data? FAQ - Analytics Platform - Matomo might also be helpful.

But one issue I could think of in your idea would be that maybe Matomo will have trouble with requests coming out of order (as you are processing the older queued requests)

Thanks for answer.

I didn’t know this Log Analytics functionnality.
But there may be a difficulty with it : how to know exactly which logs to import or not ? I would need to write down the exact moment of my Mysql dump, and then keep only the logs after that time. But there will always be some error margin if the server and I don’t have exactly the same time.

The page How do I upgrade a large Matomo instance without losing any tracking data? mentions the 2 solutions : replaying logs or using Queued Tracking plugin :slight_smile: