Bug 6025

Summary: Script to recreate entries in the statistics table from the issues and oldissues table
Product: Koha Reporter: Chris Cormack <chris>
Component: Command-line UtilitiesAssignee: Matthias Meusburger <matthias.meusburger>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: enhancement    
Priority: P3 CC: katrin.fischer, koha.sekjal, paul.poulain, tredok.pierre
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 5992    
Attachments: Proposed Patch
Followup patch
Fix Free Software Foundation address
Proposed patch

Description Chris Cormack 2011-03-31 20:27:35 UTC

    
Comment 1 Chris Cormack 2011-03-31 20:31:55 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2011-03-31 20:42:20 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2011-06-15 00:59:49 UTC
The first patch has the wrong address for the Free Software Foundation, Can we get a followup that corrects that please?
Comment 4 Matthias Meusburger 2011-09-16 10:41:09 UTC Comment hidden (obsolete)
Comment 5 Paul Poulain 2011-10-24 11:38:15 UTC
Updating Version : This ENH will be for Koha 3.8
Comment 6 Paul Poulain 2011-10-25 15:05:50 UTC
Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday)
Comment 7 Katrin Fischer 2011-12-21 05:43:56 UTC
Hi Matthias,
can you provide a test plan for this? In which circumstances one would use the script? The second patch seems to delete all documentation about the script?

All 3 patches still apply to master.
Comment 8 Matthias Meusburger 2012-02-03 10:54:34 UTC
Created attachment 7438 [details] [review]
Proposed patch
Comment 9 Matthias Meusburger 2012-02-03 11:03:38 UTC
Hi Katrin,

This script is to be used when the statistics table is incomplete. 

It happened to one of our customers: because of a database inconsistency, the statistics table was not populated during some time. 

This script was created to recreate those missing statistics from the issues and old_issues tables data.

I can't figure out why the documentation was removed from the script with the second patch, though.

Anyhow, I found a more recent version in our repository, which I attached. It adds counters for the number of issues, renewals, and returns added, as well as command-line options for processing only issues or only returns.
Comment 10 Katrin Fischer 2012-02-22 06:42:40 UTC
Hi Matthias, 
thx for your explanation! Sounds like this could be a tool for migrations too? 

I only have a very small testing database with almost no circulation activities - so it's a bit hard to test for me. Perhaps someone else with a bigger database might be willing to give this a try?
Comment 11 Pierre Angot 2012-03-19 15:29:54 UTC
Test ok on sandbox
Comment 12 Ian Walls 2012-03-19 21:40:23 UTC
Script is self-contained, so it won't affect other parts of the code (beyond updating the statistics table).

Works on both issues and renewals, though I find it a little odd that not specifying either specifies both... just a comment, not a problem.

Looks to be a very useful tool for recreating lost statistics (as best as one can).  Could be handy for migrations.

Marking as Passed QA.
Comment 13 Paul Poulain 2012-03-20 16:04:07 UTC
versionned for 3.8, to be sure I document it in my release notes, may be applied to 3.6 safely
Comment 14 Jared Camins-Esakov 2012-12-31 00:44:40 UTC
There have been no further reports of problems so I am marking this bug resolved.