[Koha] bulkmarcimport-problems!

Magnus Enger magnus at enger.priv.no
Sat Feb 18 01:01:44 NZDT 2012


Tjänare, Magdalena!

2012/2/17 Magdalena Söderqvist <soderqvist at sipri.org>:
> Hi all,
> my IT-expert is helping me import some marc-records which I have edited in Marc Edit. But importing the records back into Koha is not working. And the editing itself does not seem to be the problem, we get the same error message when trying to import the orginal, unedited .mrc file, which I pulled from the "tools/export.pl" page. Do the below messages contain enough information to tell what we're doing wrong? Any help is, as always, much appreciated. We are currently running version 3.6.2 on Debian Squeeze.
>
> Also: we're doing this on a copy of the database, could that be part of the problem?

That should not be a problem, it's a really, really good idea! ;-)

> ********************
> deleting biblios
>> > DBD::mysql: b do failed: Cannot delete or update a parent row: a
>> > foreign key constraint fails (`koha`.`issues`, CONSTRAINT
>> > `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items`
>> > (`itemnumber`) ON UPDATE CASCADE) at ./bulkmarcimport.pl line 96.
>
> *******************

Not sure about this first part.

>
> Duplicate entry 'A13150' for key 'itembarcodeidx' at
> /usr/share/koha/lib/C4/Items.pm line 361, <GEN16> line 804.
> .DBD::mysql::st execute failed: Duplicate entry 'A13151' for key
> 'itembarcodeidx' at /usr/share/koha/lib/C4/Items.pm line 2105, <GEN16>
> line 805.
> ERROR in _koha_new_item INSERT INTO items SET

>From the subject I guess you are re-importing with the
bulkmarcimport.pl command line script. How are you running that? With
what options?

The default is that Koha will add your records as if they were new,
which causes the error above, because the barcodes that you try to
import are already present in the database.

I *think* this should be taken care of if you run the script with
"-match 999c" - this should match on the biblionumber in field 999$c.
I have not tested that though...

Best regards,
Magnus Enger
libriotech.no


More information about the Koha mailing list