Bug 21010

Summary: Script to search for data inconsistencies [omnibus]
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, lars, lisettepalouse+koha, martin.renvoize, robin, victor
Version: unspecified   
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: 21169, 21264, 20509, 21011, 21150, 21466, 23871    
Bug Blocks:    

Description Jonathan Druart 2018-06-27 18:25:22 UTC

    
Comment 1 Jonathan Druart 2018-08-02 15:25:11 UTC
Bug 20509 - Data consistency - authority types


Bug 21011 - Data inconsistencies - items.holdingbranch | items.homebranch


Bug 21150 - Data inconsistencies - item types
Comment 2 Jonathan Druart 2018-08-07 18:04:07 UTC
Bug 21169 - Data inconsistencies - records without a MARC subfield mapped with biblio.biblionumber
Comment 3 Martin Renvoize 2018-08-08 14:28:58 UTC
It would be great to run these with each upgrade and set a flag if bad data is detected to raise a warning on the About page.
Comment 4 Victor Grousset/tuxayo 2018-08-08 14:36:12 UTC
I'm not sure what could be relevant to take from, but at BibLibre we have a script to check data:
https://git.biblibre.com/biblibre/tools/blob/master/koha/db_check_data.sh

- items.onloan without issue
- Orphan deletedbiblioitems or deletedbiblio
- marcxml empty
- ethnicity
- tables MyISAM
- MARC to Koha mappings : duplicates
- MARC to Koha mappings : unknown column
- MARC to Koha mappings : not like default framework
- Merge sysprefs
- Need merge authorities
- Authorised values duplicates

And also to check for auto increment issues:
https://git.biblibre.com/biblibre/tools/blob/master/koha/db_check_ai.sh

Some of the checks output the SQL to run to fix the issue. (e.g. to remove orphan/invalid data)
Comment 5 Jonathan Druart 2018-10-01 21:31:53 UTC
Bug 21466 - Data inconsistencies - items.location values must have a corresponding authorised value
Comment 6 Katrin Fischer 2018-10-01 21:33:24 UTC
(In reply to Jonathan Druart from comment #5)
> Bug 21466 - Data inconsistencies - items.location values must have a
> corresponding authorised value

What if they are not mapped to LOC? I think I remember patches to display as is in this case a while ago (Biblibre?)
Comment 7 Jonathan Druart 2018-10-19 10:31:06 UTC
*** Bug 4879 has been marked as a duplicate of this bug. ***