[Koha] authority export

Bernardo Gonzalez Kriegel bgkriegel at gmail.com
Sat Nov 17 00:08:12 NZDT 2012


Hi,
I use the following script, adapted from some other.
To use, copy & paste the code in a file (ej exportauth.pl),
and run as koha user (KOHA_CONF and PERL5LIB variables set)
"perl exportauth.pl myauth.mrc"

Hope that helps,
Bernardo

#!/usr/bin/perl
# This script allows you to export a authorities db in
# MARC21 format from the command line.
#

use strict;
BEGIN {
    use FindBin;
    eval { require "$FindBin::Bin/kohalib.pl" };
}

use C4::Context;
use C4::Biblio;
use C4::Auth;
my $outfile = $ARGV[0];
open(OUT,">$outfile") or die $!;
my $dbh=C4::Context->dbh;
$dbh->do("set character_set_connection='utf8'");
my $sth=$dbh->prepare("select marc from auth_header order by authid");
$sth->execute();
while (my ($marc) = $sth->fetchrow) {
    print OUT $marc;
 }
close(OUT);

-- 
Bernardo Gonzalez Kriegel
bgkriegel at gmail.com



On Fri, Nov 16, 2012 at 3:36 AM, Haik Zargaryan <haikzargaryan at yahoo.com>wrote:

> Dear friends,
>
> I am trying to export authority records from our catalog. I have surfed
> the web but have not found any clear solution to this problem.
> Any suggestions?
>
>
> Regards,
> Haik.
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list