The 'replace' option for items checks whether the item can be found for barcodes - it does not do so for itemnumbers: sub _batchCommitItems { ... my $duplicate_barcode = exists( $item->{'barcode'} ) && Koha::Items->find({ barcode => $item->{'barcode'} }); my $duplicate_itemnumber = exists( $item->{'itemnumber'} ); ... if ( $action eq "replace" && $duplicate_itemnumber ) { # Duplicate itemnumbers have precedence, that way we can update barcodes by overlaying ModItemFromMarc( $item_marc, $biblionumber, $item->{itemnumber}, { skip_record_index => 1 } ); The call to ModItemFromMarc fails when the item isn't there - this can happen for orders when importing final records form the vendor, but a cop has been removed etc. To recreate: 1 - Export a record containing items as MARCXML 2 - Edit an item record and add/update the 952$9 to a number not in the db 1234567890 2 - Stage the record for import, matching on kohabiblio and replacing items 3 - Import the batch 4 - It fails