delete inventory of one library
Greetings friends, we have three libraries on our Koha 3.03 and one of them now needs to be removed along with its inventory. This library shares a Library and Group (Libraries and Groups) as well as Patrons but has 6 separate Item Types and a separate Location (LOC under Authorized Values). The library does not use Acquisitions but does have issuing rules. There are materials currently charged out. (Some data appears to be inconsistent: search results show numbers available and on loan, but detailed biblios show different numbers available or on display.) We could check in each of the charged items, delete the item records, then delete the biblio. However there are approximately 4900 item records in the inventory. I've also considered migrating the part of the database we'll be keeping to another server. Is there another, better solution? 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.
On 21 January 2011 11:07, Rachel Hollis <Rachel.Hollis@stevenshenager.edu> wrote:
Greetings friends, we have three libraries on our Koha 3.03 and one of them now needs to be removed along with its inventory.
This library shares a Library and Group (Libraries and Groups) as well as Patrons but has 6 separate Item Types and a separate Location (LOC under Authorized Values). The library does not use Acquisitions but does have issuing rules. There are materials currently charged out. (Some data appears to be inconsistent: search results show numbers available and on loan, but detailed biblios show different numbers available or on display.)
We could check in each of the charged items, delete the item records, then delete the biblio. However there are approximately 4900 item records in the inventory. I've also considered migrating the part of the database we'll be keeping to another server. Is there another, better solution?
Hi Rachel Sorry for the late reply, do you have commandline access to the db? Chris
No need to apologize Chris. I do have command line access to the DB. I am a librarian but there are people here that can help me... er, stop me from breaking things. ;-) Rachel Hollis, librarian -----Original Message----- From: Chris Cormack [mailto:chris@bigballofwax.co.nz] Sent: Wednesday, January 26, 2011 2:48 AM To: Rachel Hollis Cc: Koha@lists.katipo.co.nz Subject: Re: [Koha] delete inventory of one library On 21 January 2011 11:07, Rachel Hollis <Rachel.Hollis@stevenshenager.edu> wrote:
Greetings friends, we have three libraries on our Koha 3.03 and one of them now needs to be removed along with its inventory.
This library shares a Library and Group (Libraries and Groups) as well as Patrons but has 6 separate Item Types and a separate Location (LOC under Authorized Values). The library does not use Acquisitions but does have issuing rules. There are materials currently charged out. (Some data appears to be inconsistent: search results show numbers available and on loan, but detailed biblios show different numbers available or on display.)
We could check in each of the charged items, delete the item records, then delete the biblio. However there are approximately 4900 item records in the inventory. I've also considered migrating the part of the database we'll be keeping to another server. Is there another, better solution?
Hi Rachel Sorry for the late reply, do you have commandline access to the db? Chris 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.
On 27 January 2011 09:23, Rachel Hollis <Rachel.Hollis@stevenshenager.edu> wrote:
No need to apologize Chris. I do have command line access to the DB. I am a librarian but there are people here that can help me... er, stop me from breaking things. ;-)
WARNING: Please, for your sanity sake, back your db up before doing the the following :) Right, in that case, after you have checked in the items that are out you could run a query like SELECT barcode FROM items WHERE homebranch='branch you are removing' INTO OUTFILE '/tmp/barcodes'; That gives you a file containing all the barcodes to delete, you can then load that up into the batch item deletion tool (in the tools area in Koha) Now if you want to get rid of all biblios that have no items attached, and have no orders attached to them. NOTE if you use serials you need to be careful here, if you don't then the next bit of sql is safe delete from biblio where biblionumber not in (select biblionumber from items) and biblionumber not in (select biblionumber from aqorders); Then you can delete all biblioitems that have no biblio delete from biblioitems where biblionumber not in (select biblionumber from biblio); That should have purged them. Now if you do use serials, let me know and I can try and figure out the sql for checking the biblio is not linked to a serial. Chris
Thank you Chris! You can be sure I'll back up the DB! :-) So my first step is to make sure that all items in the library to be removed have an available status, correct? The library to be removed shares a Home Library but does have a separate Shelving Location. (Good thing too because I've noticed that there are items that have different Home Libraries but with the same Shelving Location and these also need to be removed.) Would the query look like SELECT barcode FROM items WHERE items.location='location to be removed' INTO OUTFILE '/tmp/barcodes'; What I really like about this project is that only the barcodes for the one location will be deleted leaving other items on a shared biblio, sweet! Another awesome thing is that the library/location to be removed has not used Acquisitions or Serials. I've been asked why we are deleting a library and its inventory. The library will be using another automation system; I wish them luck with their project. Rachel Hollis, librarian -----Original Message----- From: Chris Cormack [mailto:chris@bigballofwax.co.nz] Sent: Wednesday, January 26, 2011 1:38 PM To: Rachel Hollis Cc: Koha@lists.katipo.co.nz Subject: Re: [Koha] delete inventory of one library On 27 January 2011 09:23, Rachel Hollis <Rachel.Hollis@stevenshenager.edu> wrote:
No need to apologize Chris. I do have command line access to the DB. I am a librarian but there are people here that can help me... er, stop me from breaking things. ;-)
WARNING: Please, for your sanity sake, back your db up before doing the the following :) Right, in that case, after you have checked in the items that are out you could run a query like SELECT barcode FROM items WHERE homebranch='branch you are removing' INTO OUTFILE '/tmp/barcodes'; That gives you a file containing all the barcodes to delete, you can then load that up into the batch item deletion tool (in the tools area in Koha) Now if you want to get rid of all biblios that have no items attached, and have no orders attached to them. NOTE if you use serials you need to be careful here, if you don't then the next bit of sql is safe delete from biblio where biblionumber not in (select biblionumber from items) and biblionumber not in (select biblionumber from aqorders); Then you can delete all biblioitems that have no biblio delete from biblioitems where biblionumber not in (select biblionumber from biblio); That should have purged them. Now if you do use serials, let me know and I can try and figure out the sql for checking the biblio is not linked to a serial. Chris 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.
On 28 January 2011 08:20, Rachel Hollis <Rachel.Hollis@stevenshenager.edu> wrote:
Thank you Chris! You can be sure I'll back up the DB! :-)
So my first step is to make sure that all items in the library to be removed have an available status, correct?
Correct
The library to be removed shares a Home Library but does have a separate Shelving Location. (Good thing too because I've noticed that there are items that have different Home Libraries but with the same Shelving Location and these also need to be removed.) Would the query look like SELECT barcode FROM items WHERE items.location='location to be removed' INTO OUTFILE '/tmp/barcodes';
That would do it. You could find the ones on issue too, to help return them all quickly SELECT barcode FROM items,issues WHERE items.itemnumber=issues.itemnumber AND items.location='location'; That will give you a list of barcodes of items on issue.
What I really like about this project is that only the barcodes for the one location will be deleted leaving other items on a shared biblio, sweet! Another awesome thing is that the library/location to be removed has not used Acquisitions or Serials.
Easy peasy then.
I've been asked why we are deleting a library and its inventory. The library will be using another automation system; I wish them luck with their project.
Ahh thats a shame, but nonetheless good luck to them, I hope its another open source system, its always sad to see people pay to lose their freedom. Chris
Apologies if this email comes through twice. On 28 January 2011 08:20, Rachel Hollis <Rachel.Hollis@stevenshenager.edu> wrote:
Thank you Chris! You can be sure I'll back up the DB! :-)
So my first step is to make sure that all items in the library to be removed have an available status, correct?
Correct
The library to be removed shares a Home Library but does have a separate Shelving Location. (Good thing too because I've noticed that there are items that have different Home Libraries but with the same Shelving Location and these also need to be removed.) Would the query look like SELECT barcode FROM items WHERE items.location='location to be removed' INTO OUTFILE '/tmp/barcodes';
That would do it. You could find the ones on issue too, to help return them all quickly SELECT barcode FROM items,issues WHERE items.itemnumber=issues.itemnumber AND items.location='location'; That will give you a list of barcodes of items on issue.
What I really like about this project is that only the barcodes for the one location will be deleted leaving other items on a shared biblio, sweet! Another awesome thing is that the library/location to be removed has not used Acquisitions or Serials.
Easy peasy then.
I've been asked why we are deleting a library and its inventory. The library will be using another automation system; I wish them luck with their project.
Ahh thats a shame, but nonetheless good luck to them, I hope its another open source system, its always sad to see people pay to lose their freedom. Chris -- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand
participants (3)
-
Chris Cormack -
Chris Cormack -
Rachel Hollis