Reprocessing usage stats after base_url has changed

Hi, I’m wondering if there’s an easy way to tackle this issue. We recently switched one of our instances from http to https and now I’m in a position where I need to reprocess a bunch of usage logs from before the switch; one of the journals didn’t have their base_url in the config file so its usage wasn’t being reported.

Anyway, if I change all of the base_urls to http://… the journals don’t display properly so I can’t do that while the reprocessing runs, which might take a few days. Anyone have any ideas?

In this thread (reprocessing-usagestats-in-ojs3-0-2/33305/2) bozana recommends doing it in a non-production instance and then copying the metrics table to production. Is this the only way?

Hi Bart,

Another option would be to change all references of http://yourdomain.com to https://yourdomain.com in the log files and reprocess. Probably best to make a backup of everything before you do this (including the metrics table and log files). @bozana May have some other thoughts here as well.

Thanks jmacgreg! I should’ve thought of that.

sed -i -e 's|http:|https:|' * did the trick if someone else runs into this issue / thread.

Thanks @bart and @jmacgreg!

I will try to add an option to consider the base_url change and maybe especially http to https change for log files processing in the current usage stats plugin – I am not sure at the moment how to solve it exactly, but… track this issue for that: Eventually consider base_url change in usage statistics · Issue #3777 · pkp/pkp-lib · GitHub.

Best,
Bozana