[Koha] Koha won't import items when importing MARC records

Jonathan Druart jonathan.druart at bugs.koha-community.org
Tue Jul 4 22:16:56 NZST 2023


Hi,

The error message (from the DBMS) is cut, please provide the full message.
My guess is that the branchcode ("PRBHS") does not exist in the DB.

Regards,
Jonathan

Le ven. 30 juin 2023 à 19:20, Furst, Kevin <kfurst at prbschools.org> a écrit :
>
> Hello,
>
> TL;DR = When importing MARC records, items don't import and fail.
>
> I am transitioning from Follett Destiny to Koha. After doing a MARC export
> from Follett, I noticed that when staging records for import, Koha would
> parse the biblio records fine but wouldn't find any item records. After
> searching past messages in this list, I found that Follett has item records
> as 852 instead of 952. I used MARCedit to change those to 952 and also
> added a and b records to match the libraries listed in Koha. After doing
> that and trying again, item records were then found during staging.
>
> However when I import the staged records, it just fails and gives me
> nothing in the detailed messages in the UI. If I remove the 952 records, it
> works fine and imports all the other records thus I know something is wrong
> with my 952 entries. I have checked that there are p barcodes and a and b
> home and current libraries.
>
> In the Koha logs on the server, this is the only error message I get when I
> try to run an import and it fails.  To me it seems like a FK is missing on
> import but I don't know what. Looking at the schema example, I'm wondering
> if I'm supposed to be importing things to 942 and 999 along with 952. I do
> not know if, when importing MARC records, Koha creates its own enumerated
> ids for biblio, item number, etc. if that stuff isn't in the import file...
> or if it isn't there, will it fail?
>
> BIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st
> execute failed: Cannot add or update a child row: a foreign key constraint
> fails (`koha_library`.`items`, CONSTRAINT `items_ibfk_>
>
> Broken FK constraint at
> /usr/share/koha/lib/Koha/BackgroundJob/MARCImportCommitBatch.pm line 91.
>
> Here are a couple of 952 records from the Follett export to Koha import
> file to see if something simple is wrong. I'm hoping it's something simple
> on these lines.
>
>
> =952  \\$p34517100010472$aPRBHS$bPRBHS$bStory
> Collection$v10.00USD$x14441$eaRegular at c20060929@fTransfer from PRB Elem. at j
> @j at j@i at i@i$hSC Otf$x1127380
>
> =952  \\$p3333300007200O$aPRBHS$bPRBHS$v20.00USD$x17292$eaRegular at c20050604
> @j at j@j at i@i at i$hR 639 Can pb$x527111
>
>
> (Beyond that, I haven't really tinkered with anything in the default MARC
> framework settings in admin.
> Here is my version :
> *Koha version:22.11.05.000 Rosalie*
>
> I would really appreciate any help, I've been working on this for over a
> week now.
>
> *Kevin Furst*
> Technology Director
> Pine River-Backus Schools
> o | 218.587.8030
> @ | kfurst at prbschools.org
>
> Technology Office/Help Desk:  218-587-8510
>
> *Confidentiality Notice: This E-mail message, including any attachments, is
> for the sole use of the intended recipient(s) and may contain confidential
> and privileged information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply E-mail and destroy all copies of the original
> message.*
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list