[Koha] anonymize circulation history

Susan Bennett susan.bennett at geaugalibrary.info
Fri May 8 08:53:32 NZST 2009


Would it be less dangerous to use the SQL to local the records but instead
of insert into old.issues replace the NULL value with a patron record that
you created for this purpose - I'd suggest a patron type with no fies :-)?
That way if you had the items in hand you could check them in, staff could
look for the items on the shelves to check in any that are already shelved
and you'd then know what items where still checked out. The normal check in
would correct any that were returned by patrons later.

something like:
mysql> update issues set borrowernumber = (your dummy patrons id) where
borrowernumber is NULL;

Mark (at LibLime) used this to fix records for us that had NULL borrowers.

Susan Bennett
ILS System Administrator
Geauga County Public Library
440 286-6811 x 125
440 286-7419 FAX


On Thu, May 7, 2009 at 4:28 PM, Galen Charlton
<galen.charlton at liblime.com>wrote:

> Hi Rachel,
>
> 2009/5/7 Rachel Hollis <Rachel.Hollis at stevenshenager.edu>:
> > 4. Affected items checked-in are “not checked out” - they cannot be
> returned
> > so are forever overdue? is this because they are separated from patron
> data?
>
> Yes.  There is a way to get rid of them, which will require use of
> SQL.  With this sort of SQL update, it a good idea (nay, required!) to
> do a complete backup beforehand, perform the update outside of normal
> library hours, check the results right away, and be prepared to
> restore from backup.
>
> The process would looks like this:
>
> 1. Do your backup.
>
> 2. Find out exactly how many loans are now ghosts:
>
> SELECT COUNT(*)
> FROM issues
> WHERE borrowernumber IS NULL;
>
> 2. Copy those loans that were incorrectly anonymized to the issue
> history table using the following SQL:
>
> INSERT INTO old_issues
> SELECT * FROM issues
> WHERE borrowernumber IS NULL;
>
> 3. Actually delete those ghost loans:
>
> DELETE FROM issues
> WHERE borrowernumber IS NULL;
>
> 4. Clear the item record's copy of the due date:
>
> UPDATE items
> SET onloan = null
> WHERE itemnumber NOT IN (SELECT itemnumber FROM issues);
>
> After you do this, those items will no longer be on loan.  Because of
> how Koha stores item information, and specifically the due date, you
> may see a couple spots, probably in search results, where it appears
> that the item still has a due date, but that won't prevent the item
> from circulating.
>
> This procedure will *most likely* allow these items to be circulated
> again, although without a backup it is impossible to restore the
> original borrowernumbers.  Although I try not to overburden messages
> with disclaimers, one definitely applies here: although I am happy to
> answer further questions, actually running the update you would do at
> your own risk - please be sure that your are certain that you can
> backup and restore your database before trying this.
>
> A fix for the underlying bug (null borrower numbers in the issues
> table) is being worked on.
>
> Regards,
>
> Galen
> --
> Galen Charlton
> VP, Research & Development, LibLime
> galen.charlton at liblime.com
> p: 1-888-564-2457 x709
> skype: gmcharlt
> _______________________________________________
> Koha mailing list
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20090507/36bbf2c6/attachment-0001.htm 


More information about the Koha mailing list