[Koha] restore with 2 week old backup

Chris Cormack chrisc at catalyst.net.nz
Thu Jan 6 08:25:11 NZDT 2011


* Rachel Hollis (Rachel.Hollis at stevenshenager.edu) wrote:
> Greetings friends, approximately two weeks ago one or more of the staff removed data from our Koha 3.01 database. We now have items separated from borrowers. As far as I can guess, the delete all items function was used while viewing biblios and items that were checked out were also deleted.
> 
> When viewing an affected borrower record, a due date appears but not item information. When browsing the catalog, the total number of items displays along with numbers available and numbers checked out but the numbers are not correct.
> 
> We can restore from a backup but we'd lose about two weeks worth of work. Is there another solution?
> 
Yeah, you don't want to do that. 

For the immediate situation, set up a database (ie make a new one)
mysqladmin -uroot -p create koha_restore

Load the backup into there

Now you have the items in a db, if you know the itemnumbers already you
can just do this

mysql -uroot -p koha_restore

mysql> select * from items where itemnumber in (numbers,go,here) into
outfile '/tmp/missingitems.txt';

mysql> quit;

mysql -uroot -p koha

mysql> load data infile '/tmp/missingitems.txt' into items;

mysql> quit;

Now you have the items in the items table, the borrower record will show
the item. The only problem is, these items wont be in the MARC, so you
wont be able to edit them etc.

If you want them in the MARC there is a script in misc/maintenance
called  sync_items_in_marc_bib.pl which should fix that up for you.

Please run that when the library is closed and after taking a backup.

If you dont have a list of itemnumbers, you can get that list this way

mysql -uroot -p koha

mysql> select issues.itemnumber from issues left join items on
(issues.itemnumber = items.itemnumber) where items.itemnumber is null;


Hope this helps

Chris


> Rachel Hollis, librarian
> Stevens-Henager College, Boise Idaho Campus
> 
> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha

-- 
Chris Cormack
Catalyst IT Ltd.
+64 4 803 2238
PO Box 11-053, Manners St, Wellington 6142, New Zealand
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.katipo.co.nz/pipermail/koha/attachments/20110106/7aad2c1b/attachment.pgp 


More information about the Koha mailing list