As bulkmarcimport is mostly used for doing the initial loading of a database and already allows to delete all bibliographic and authority records using the -d parameter, it would also make sense to offere an option to clean the deleted* tables in the same step as starting a new import. Maybe this should be optional as bulkmarcimport also provides some matching capabilities that indicate it's not always used on an empty db. But if you delete "all" with -d it might still be a safe assumption? Having some warnings in place about the change might be good.
I wonder: if you delete in the db here, shouldn't this also happen to the search index (whatever one is used)? Just as I ran into some funny behaviour the other day that was cured by cleaning up the Zebras.
It's an interesting question. We used to stop the koha-indexer and do a full index after, that will reset properly. If you want to use the koha-indexer, you can reset the indexes before importing, we use: $ sudo koha-shell -l SITE $ zebraidx -c /etc/koha/sites/SITE/zebra-biblios-dom.cfg init $ zebraidx -c /etc/koha/sites/SITE/zebra-authorities-dom.cfg init I am not sure if that could be built into the script, but it woudld certainly be for another bug. :)
> We used to stop the koha-indexer and do a full index after, that will reset properly. This is what my installer does as well. Most likely we even discussed the steps back when I added this. I was just wondering as your initial bug heads quite a bit towards "make it consistent" and it might not be too obvious that the index isn't cleared if you `bulkmarcimport -d`.
(In reply to Alexander Wagner from comment #3) > > We used to stop the koha-indexer and do a full index after, that will reset properly. > > This is what my installer does as well. Most likely we even discussed the > steps back when I added this. > > I was just wondering as your initial bug heads quite a bit towards "make it > consistent" and it might not be too obvious that the index isn't cleared if > you `bulkmarcimport -d`. I was just trying to keep the changes required as small as possible, as I probably won't be able to work on this anytime soon. I think handling the indexes could be a separate bug as we also need to check Zebra and/or Elasticsearch. Maybe a visible hint/reminder when the script is run would help for a start?
> Maybe a visible hint/reminder when the script is run would help for a start? Sounds good. It avoids that you assume some magic that doesn't happen.