Reloading data in from the web logs

Hi guys,

It looks I’ve had disk space issues on my Matomo DB server which has stopped a fair amount of data being written to the db since 6 am this morning

The server is all sorted now but we have a gap in the analytics. Having said that as we have a separate web-server, we have all of the raw logs for all of the analytics. Is there a way that I can reload the database from these logs?

Many Thanks

In case you have the access.log of you Matomo instance in that time range (not the site that was tracked), you can use this really obscure feature to send all this data again to Matomo:

Hi Lukas, many thanks for the response

I have the logs in place and executed the python script but hit a snag - I received this error;

“Fatal error: the selected log format doesn’t include the hostname: you must specify the Matomo site ID with the --idsite argument”

Issue is, I’ve got tracking stats for a few different websites in this log file (mapped to different site IDs) so if i add the --idsite argument, will it move all of the data into that specified site ID? Obviously i want the data flowing to their correct Site Ids in the database.

Many Thanks in advance!


According to the code:

you should never get to that error message if you added the --replay-tracking parameter.

Thanks Lucas, as ever to the rescue!