[Koha] Building authority records after data migration

Pablo Bianchi pablo.bianchi at gmail.com
Fri Oct 4 02:46:53 NZDT 2013


2013/6/18 Galen Charlton <gmc at esilibrary.com>

> On Tue, Jun 18, 2013 at 12:14 AM, Iming Chan <imingchan at yahoo.com.au>
> wrote:
> > Recently, I have successfully migrated all bibliographic records into
> Koha
> > 3.12.  I would like to find out how to build up authority records using
> bib.
> > records that are in Koha?  There doesn't seem to be any instruction on
> this
> > that will help newbie (like myself) to achieve this.
> My general recommendation for this sort of situation is to *not* build
> authority records based on the bib records.  Why?  First,
> machine-created authority records will end up "authorizing" any typos
> and other errors that may exist in your bib headings.  Second, much of
> the value of authority records, particularly for Koha's headings
> search feature, comes from cross-references, which can't be
> machine-generated.  Consequently, I recommend that you consider
> downloading authority records from sources such as LC and NLA or using
> an authority control service.
>
> That said, if you want to proceed, you can make Koha create authority
> records by first turning on both the AutoCreateAuthorities and
> BiblioAddsAuthorities system preferences, then saving each bib record
> individually (and slowly, so that Koha stays on top of indexing the
> new authority records).
>
> At the moment, there isn't an easy, reliable way to do so as a batch
> operation; while running the command line link_bibs_to_authorities.pl
> script will create authority records automatically if the two system
> preferences I mentioned are enabled, doing it in one fell swoop will
> creating duplicate authority records.  Why?  Because newly-created
> authority aren't indexed instantaneously, so a new one may exist in
> the database but not be findable by the linker script yet.
>
> To work around that, you could write a script that did the equivalent of
>
> link_bibs_to_authorities.pl  --bib-limit 'biblionumber = 1'
> misc/migration_tools/rebuild_zebra.pl -b -a -z
> link_bibs_to_authorities.pl  --bib-limit 'biblionumber = 2'
> misc/migration_tools/rebuild_zebra.pl -b -a -z
> link_bibs_to_authorities.pl  --bib-limit 'biblionumber = 3'
> misc/migration_tools/rebuild_zebra.pl -b -a -z
> ...
> link_bibs_to_authorities.pl  --bib-limit 'biblionumber = 9999'
> misc/migration_tools/rebuild_zebra.pl -b -a -z
>

I add a line (around 96) to execute rebuild_zebra.pl just before processing
each record:
*[...]
while ( my ($biblionumber) = $sth->fetchrow_array() ) {
    system("/usr/bin/perl /usr/share/koha/bin/migration_tools/
rebuild_zebra.pl -b -a -z");
    $num_bibs_processed++;
    process_bib( $linker, $biblionumber )
    [...]*

In my case it took about 3 minutes for each 100 records.
Note *migration_tools*/ is under bin because is a standard package
installation instead of a git one.

But, even this *should *work, it seems it doesn't, I wonder why... Paths
are correct.
Are any other workaround to generate authorities from biblio records? Or a
script to deduplicate authorities...

Regards!
Pablo Bianchi
Bs As, Argentina
​


More information about the Koha mailing list