How to freeze Piwik interface?

Hello,

We have been collecting statistics with an old Piwik installation:

Last Changed Author: matt
Last Changed Rev: 1183
Last Changed Date: 2009-06-03 02:01:36 +0200 (Wed, 03 Jun 2009)

I couldn’t find a reference to the version number in the code or interface, but from what I could find, it should be a 1.0

We wish to archive this Piwik installation and stop collecting data. Then when accessing the Piwik interface, we need to stay on the last collected day and avoid seeing the statistics after we stopped the collection.

Is there an easy way to do this? If it involves modifying the code, can you give me some hints? Piwik should stop computing and only enable visualization of past statistics.

Thanks,
S.

Bump.

I just need to hardcode the value for “today” so that Piwik will freeze at an arbitrary date. Where can I do that? I tried to hook some code in Period/Range.php and Controller.php with no apparent success.

So I have made some progress it seems. Each user has the possibility to set the start date for the interface. Using this query effectively changes the default date. However the code seems to expect only a set of strings (today, yesterday, …) in this case, so it has to be hacked in a way. It should not be that hard since Piwik_Date handles classic date strings and is used pretty much anywhere.

UPDATE piwik_option SET option_value = ‘2013-10-08’ WHERE option_name REGEXP ‘Date$’

In the meantime, if someone can correct me or point me the way to the next step, I am still interested.

Thanks.

Alright got it. No need to update the DB since the code has to be hacked.

Core/Controller.php
-> getDefaultDate()
-> getDefaultPeriod()

Noticed some wrong comments around there, copy pasta? Anyways, it works but I hope that in newer versions it will be easier and that users can specify an arbitrary date.

I am worried though that the calendar will still try to keep up with “today”. I guess I will have to wait and see (and hack again).

I will keep reading this topic in case someone has a comment/better idea.

You can just directly link to your Piwik installation and set date=2013-10-01 or any arbitrary date you want to fix to.

The thing is, people will not want to do that as if you click on the piwik logo at the top, it brings you to “today”. With that hack, today is the data I chose and I do not need a specific URL to share with everybody.

It’s been two weeks and it’s working pretty well, I am still waiting for next Friday, to see if switching the current month might affect something, but I doubt it.