7 use File::Temp qw/ tempdir /;
10 use C4::AuthoritiesMarc;
13 # script that checks zebradir structure & create directories & mandatory files if needed
17 $|=1; # flushes output
30 my $process_zebraqueue;
31 my $result = GetOptions(
39 'munge-config' => \$do_munge,
41 'h|help' => \$want_help,
43 'z' => \$process_zebraqueue,
47 if (not $result or $want_help) {
52 if (not $biblios and not $authorities) {
53 my $msg = "Must specify -b or -a to reindex bibs or authorities\n";
54 $msg .= "Please do '$0 --help' to see usage.\n";
58 if ($authorities and $as_xml) {
59 my $msg = "Cannot specify both -a and -x\n";
60 $msg .= "Please do '$0 --help' to see usage.\n";
64 if ($process_zebraqueue and ($skip_export or $reset)) {
65 my $msg = "Cannot specify -r or -s if -z is specified\n";
66 $msg .= "Please do '$0 --help' to see usage.\n";
76 $directory = tempdir(CLEANUP => ($keep_export ? 0 : 1));
80 my $biblioserverdir = C4::Context->zebraconfig('biblioserver')->{directory};
81 my $authorityserverdir = C4::Context->zebraconfig('authorityserver')->{directory};
83 my $kohadir = C4::Context->config('intranetdir');
84 my $dbh = C4::Context->dbh;
85 my ($biblionumbertagfield,$biblionumbertagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
86 my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaField("biblioitems.biblioitemnumber","");
88 print "Zebra configuration information\n";
89 print "================================\n";
90 print "Zebra biblio directory = $biblioserverdir\n";
91 print "Zebra authorities directory = $authorityserverdir\n";
92 print "Koha directory = $kohadir\n";
93 print "BIBLIONUMBER in : $biblionumbertagfield\$$biblionumbertagsubfield\n";
94 print "BIBLIOITEMNUMBER in : $biblioitemnumbertagfield\$$biblioitemnumbertagsubfield\n";
95 print "================================\n";
101 $dbh->{AutoCommit} = 0; # don't autocommit - want a consistent view of the zebraqueue table
104 index_records('authority', $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml);
105 $dbh->commit(); # commit changes to zebraqueue, if any
107 print "skipping authorities\n";
111 index_records('biblio', $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml);
112 $dbh->commit(); # commit changes to zebraqueue, if any
114 print "skipping biblios\n";
118 print "====================\n";
120 print "====================\n";
122 print "NOTHING cleaned : the export $directory has been kept.\n";
123 print "You can re-run this script with the -s ";
125 print " and -d $directory parameters";
130 print "if you just want to rebuild zebra after changing the record.abs\n";
131 print "or another zebra config file\n";
133 unless ($use_tempdir) {
134 # if we're using a temporary directory
135 # created by File::Temp, it will be removed
137 rmtree($directory, 0, 1);
138 print "directory $directory deleted\n";
143 my ($record_type, $directory, $skip_export, $process_zebraqueue, $as_xml, $noxml) = @_;
145 my $num_records_exported = 0;
146 my $num_records_deleted = 0;
148 print "====================\n";
149 print "SKIPPING $record_type export\n";
150 print "====================\n";
152 print "====================\n";
153 print "exporting $record_type\n";
154 print "====================\n";
155 mkdir "$directory" unless (-d $directory);
156 mkdir "$directory/$record_type" unless (-d "$directory/$record_type");
157 if ($process_zebraqueue) {
158 my $sth = select_zebraqueue_records($record_type, 'deleted');
159 mkdir "$directory/del_$record_type" unless (-d "$directory/del_$record_type");
160 $num_records_deleted = generate_deleted_marc_records($record_type, $sth, "$directory/del_$record_type", $as_xml);
161 mark_zebraqueue_done($record_type, 'deleted');
162 $sth = select_zebraqueue_records($record_type, 'updated');
163 mkdir "$directory/upd_$record_type" unless (-d "$directory/upd_$record_type");
164 $num_records_exported = export_marc_records($record_type, $sth, "$directory/upd_$record_type", $as_xml, $noxml);
165 mark_zebraqueue_done($record_type, 'updated');
167 my $sth = select_all_records($record_type);
168 $num_records_exported = export_marc_records($record_type, $sth, "$directory/$record_type", $as_xml, $noxml);
173 # and reindexing everything
175 print "====================\n";
176 print "REINDEXING zebra\n";
177 print "====================\n";
178 my $record_fmt = ($as_xml) ? 'marcxml' : 'iso2709' ;
179 if ($process_zebraqueue) {
180 do_indexing($record_type, 'delete', "$directory/del_$record_type", $reset, $noshadow, $record_fmt)
181 if $num_records_deleted;
182 do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt)
183 if $num_records_exported;
185 do_indexing($record_type, 'update', "$directory/$record_type", $reset, $noshadow, $record_fmt)
186 if $num_records_exported;
190 sub select_zebraqueue_records {
191 my ($record_type, $update_type) = @_;
193 my $server = ($record_type eq 'biblio') ? 'biblioserver' : 'authorityserver';
194 my $op = ($update_type eq 'deleted') ? 'recordDelete' : 'specialUpdate';
196 my $sth = $dbh->prepare("SELECT DISTINCT biblio_auth_number
201 $sth->execute($server, $op);
205 sub mark_zebraqueue_done {
206 my ($record_type, $update_type) = @_;
208 my $server = ($record_type eq 'biblio') ? 'biblioserver' : 'authorityserver';
209 my $op = ($update_type eq 'deleted') ? 'recordDelete' : 'specialUpdate';
211 if ($op eq 'recordDelete') {
212 my $sth = $dbh->prepare("UPDATE zebraqueue SET done = 1
217 JOIN zebraqueue z2 ON z2.biblio_auth_number = z1.biblio_auth_number
226 $sth->execute($server, $server, $op); # if we've deleted a record, any prior specialUpdates are void
228 my $sth = $dbh->prepare("UPDATE zebraqueue SET done = 1
232 $sth->execute($server, $op);
236 sub select_all_records {
237 my $record_type = shift;
238 return ($record_type eq 'biblio') ? select_all_biblios() : select_all_authorities();
241 sub select_all_authorities {
242 my $sth = $dbh->prepare("SELECT authid FROM auth_header");
247 sub select_all_biblios {
248 my $sth = $dbh->prepare("SELECT biblionumber FROM biblioitems ORDER BY biblionumber");
253 sub export_marc_records {
254 my ($record_type, $sth, $directory, $as_xml, $noxml) = @_;
256 my $num_exported = 0;
257 open (OUT, ">:utf8 ", "$directory/exported_records") or die $!;
259 while (my ($record_number) = $sth->fetchrow_array) {
261 print "\r$i" unless ($i++ %100);
262 my ($marc) = get_corrected_marc_record($record_type, $record_number, $noxml);
264 # FIXME - when more than one record is exported and $as_xml is true,
265 # the output file is not valid XML - it's just multiple <record> elements
266 # strung together with no single root element. zebraidx doesn't seem
267 # to care, though, at least if you're using the GRS-1 filter. It does
268 # care if you're using the DOM filter, which requires valid XML file(s).
269 print OUT ($as_xml) ? $marc->as_xml_record() : $marc->as_usmarc();
273 print "\nRecords exported: $num_exported\n";
275 return $num_exported;
278 sub generate_deleted_marc_records {
279 my ($record_type, $sth, $directory, $as_xml) = @_;
281 my $num_exported = 0;
282 open (OUT, ">:utf8 ", "$directory/exported_records") or die $!;
284 while (my ($record_number) = $sth->fetchrow_array) {
285 print "\r$i" unless ($i++ %100);
288 my $marc = MARC::Record->new();
289 if ($record_type eq 'biblio') {
290 fix_biblio_ids($marc, $record_number, $record_number);
292 fix_authority_id($marc, $record_number);
294 if (C4::Context->preference("marcflavour") eq "UNIMARC") {
295 fix_unimarc_100($marc);
298 print OUT ($as_xml) ? $marc->as_xml_record() : $marc->as_usmarc();
301 print "\nRecords exported: $num_exported\n";
303 return $num_exported;
308 sub get_corrected_marc_record {
309 my ($record_type, $record_number, $noxml) = @_;
311 my $marc = get_raw_marc_record($record_type, $record_number, $noxml);
315 if ($record_type eq 'biblio') {
316 my $succeeded = fix_biblio_ids($marc, $record_number);
317 return unless $succeeded;
319 fix_authority_id($marc, $record_number);
321 if (C4::Context->preference("marcflavour") eq "UNIMARC") {
322 fix_unimarc_100($marc);
329 sub get_raw_marc_record {
330 my ($record_type, $record_number, $noxml) = @_;
333 if ($record_type eq 'biblio') {
335 my $fetch_sth = $dbh->prepare_cached("SELECT marc FROM biblioitems WHERE biblionumber = ?");
336 $fetch_sth->execute($record_number);
337 if (my ($blob) = $fetch_sth->fetchrow_array) {
338 $marc = MARC::Record->new_from_usmarc($blob);
340 warn "failed to retrieve biblio $record_number";
342 $fetch_sth->finish();
344 eval { $marc = GetMarcBiblio($record_number); };
346 warn "failed to retrieve biblio $record_number";
351 eval { $marc = GetAuthority($record_number); };
353 warn "failed to retrieve authority $record_number";
361 # FIXME - this routine is suspect
362 # It blanks the Leader/00-05 and Leader/12-16 to
363 # force them to be recalculated correct when
364 # the $marc->as_usmarc() or $marc->as_xml() is called.
365 # But why is this necessary? It would be a serious bug
366 # in MARC::Record (definitely) and MARC::File::XML (arguably)
367 # if they are emitting incorrect leader values.
370 my $leader = $marc->leader;
371 substr($leader, 0, 5) = ' ';
372 substr($leader, 10, 7) = '22 ';
373 $marc->leader(substr($leader, 0, 24));
377 # FIXME - it is essential to ensure that the biblionumber is present,
378 # otherwise, Zebra will choke on the record. However, this
379 # logic belongs in the relevant C4::Biblio APIs.
380 my ($marc, $biblionumber) = @_;
381 my $biblioitemnumber;
383 $biblioitemnumber = shift;
385 my $sth = $dbh->prepare(
386 "SELECT biblioitemnumber FROM biblioitems WHERE biblionumber=?");
387 $sth->execute($biblionumber);
388 ($biblioitemnumber) = $sth->fetchrow_array;
390 unless ($biblioitemnumber) {
391 warn "failed to get biblioitemnumber for biblio $biblionumber";
396 # FIXME - this is cheating on two levels
397 # 1. C4::Biblio::_koha_marc_update_bib_ids is meant to be an internal function
398 # 2. Making sure that the biblionumber and biblioitemnumber are correct and
399 # present in the MARC::Record object ought to be part of GetMarcBiblio.
401 # On the other hand, this better for now than what rebuild_zebra.pl used to
402 # do, which was duplicate the code for inserting the biblionumber
403 # and biblioitemnumber
404 C4::Biblio::_koha_marc_update_bib_ids($marc, '', $biblionumber, $biblioitemnumber);
409 sub fix_authority_id {
410 # FIXME - as with fix_biblio_ids, the authid must be present
411 # for Zebra's sake. However, this really belongs
412 # in C4::AuthoritiesMarc.
413 my ($marc, $authid) = @_;
414 unless ($marc->field('001') and $marc->field('001')->data() eq $authid){
415 $marc->delete_field($marc->field('001'));
416 $marc->insert_fields_ordered(MARC::Field->new('001',$authid));
420 sub fix_unimarc_100 {
421 # FIXME - again, if this is necessary, it belongs in C4::AuthoritiesMarc.
425 if ( length($marc->subfield( 100, "a" )) == 35 ) {
426 $string = $marc->subfield( 100, "a" );
427 my $f100 = $marc->field(100);
428 $marc->delete_field($f100);
431 $string = POSIX::strftime( "%Y%m%d", localtime );
433 $string = sprintf( "%-*s", 35, $string );
435 substr( $string, 22, 6, "frey50" );
436 unless ( length($marc->subfield( 100, "a" )) == 35 ) {
437 $marc->delete_field($marc->field(100));
438 $marc->insert_grouped_field(MARC::Field->new( 100, "", "", "a" => $string ));
443 my ($record_type, $op, $record_dir, $reset_index, $noshadow, $record_format) = @_;
445 my $zebra_server = ($record_type eq 'biblio') ? 'biblioserver' : 'authorityserver';
446 my $zebra_db_name = ($record_type eq 'biblio') ? 'biblios' : 'authorities';
447 my $zebra_config = C4::Context->zebraconfig($zebra_server)->{'config'};
448 my $zebra_db_dir = C4::Context->zebraconfig($zebra_server)->{'directory'};
450 system("zebraidx -c $zebra_config -g $record_format -d $zebra_db_name init") if $reset_index;
451 system("zebraidx -c $zebra_config $noshadow -g $record_format -d $zebra_db_name $op $record_dir");
452 system("zebraidx -c $zebra_config -g $record_format -d $zebra_db_name commit") unless $noshadow;
458 $0: reindex MARC bibs and/or authorities in Zebra.
460 Use this batch job to reindex all biblio or authority
461 records in your Koha database. This job is useful
462 only if you are using Zebra; if you are using the 'NoZebra'
463 mode, this job should not be used.
466 -b index bibliographic records
468 -a index authority records
470 -z select only updated and deleted
471 records marked in the zebraqueue
472 table. Cannot be used with -r
475 -r clear Zebra index before
476 adding records to index
478 -d Temporary directory for indexing.
479 If not specified, one is automatically
480 created. The export directory
481 is automatically deleted unless
482 you supply the -k switch.
484 -k Do not delete export directory.
486 -s Skip export. Used if you have
487 already exported the records
490 -noxml index from ISO MARC blob
491 instead of MARC XML. This
492 option is recommended only
495 -x export and index as xml instead of is02709 (biblios only).
496 use this if you might have records > 99,999 chars,
498 -w skip shadow indexing for this batch
500 -munge-config Deprecated option to try
501 to fix Zebra config files.
502 --help or -h show this message.
506 # FIXME: the following routines are deprecated and
507 # will be removed once it is determined whether
508 # a script to fix Zebra configuration files is
512 # creating zebra-biblios.cfg depending on system
515 # getting zebraidx directory
517 foreach (qw(/usr/local/bin/zebraidx
526 unless ($zebraidxdir) {
528 ERROR: could not find zebraidx directory
529 ERROR: Either zebra is not installed,
530 ERROR: or it's in a directory I don't checked.
531 ERROR: do a which zebraidx and edit this file to add the result you get
535 $zebraidxdir =~ s/\/bin\/.*//;
536 print "Info : zebra is in $zebraidxdir \n";
538 # getting modules directory
540 foreach (qw(/usr/local/lib/idzebra-2.0/modules/mod-grs-xml.so
541 /usr/local/lib/idzebra/modules/mod-grs-xml.so
542 /usr/lib/idzebra/modules/mod-grs-xml.so
543 /usr/lib/idzebra-2.0/modules/mod-grs-xml.so
550 unless ($modulesdir) {
552 ERROR: could not find mod-grs-xml.so directory
553 ERROR: Either zebra is not properly compiled (libxml2 is not setup and you don t have mod-grs-xml.so,
554 ERROR: or it's in a directory I don't checked.
555 ERROR: find where mod-grs-xml.so is and edit this file to add the result you get
559 $modulesdir =~ s/\/modules\/.*//;
560 print "Info: zebra modules dir : $modulesdir\n";
562 # getting tab directory
564 foreach (qw(/usr/local/share/idzebra/tab/explain.att
565 /usr/local/share/idzebra-2.0/tab/explain.att
566 /usr/share/idzebra/tab/explain.att
567 /usr/share/idzebra-2.0/tab/explain.att
576 ERROR: could not find explain.att directory
577 ERROR: Either zebra is not properly compiled,
578 ERROR: or it's in a directory I don't checked.
579 ERROR: find where explain.att is and edit this file to add the result you get
583 $tabdir =~ s/\/tab\/.*//;
584 print "Info: tab dir : $tabdir\n";
587 # AUTHORITIES creating directory structure
589 my $created_dir_or_file = 0;
591 print "====================\n";
592 print "checking directories & files for authorities\n";
593 print "====================\n";
594 unless (-d "$authorityserverdir") {
595 system("mkdir -p $authorityserverdir");
596 print "Info: created $authorityserverdir\n";
597 $created_dir_or_file++;
599 unless (-d "$authorityserverdir/lock") {
600 mkdir "$authorityserverdir/lock";
601 print "Info: created $authorityserverdir/lock\n";
602 $created_dir_or_file++;
604 unless (-d "$authorityserverdir/register") {
605 mkdir "$authorityserverdir/register";
606 print "Info: created $authorityserverdir/register\n";
607 $created_dir_or_file++;
609 unless (-d "$authorityserverdir/shadow") {
610 mkdir "$authorityserverdir/shadow";
611 print "Info: created $authorityserverdir/shadow\n";
612 $created_dir_or_file++;
614 unless (-d "$authorityserverdir/tab") {
615 mkdir "$authorityserverdir/tab";
616 print "Info: created $authorityserverdir/tab\n";
617 $created_dir_or_file++;
619 unless (-d "$authorityserverdir/key") {
620 mkdir "$authorityserverdir/key";
621 print "Info: created $authorityserverdir/key\n";
622 $created_dir_or_file++;
625 unless (-d "$authorityserverdir/etc") {
626 mkdir "$authorityserverdir/etc";
627 print "Info: created $authorityserverdir/etc\n";
628 $created_dir_or_file++;
632 # AUTHORITIES : copying mandatory files
634 # the record model, depending on marc flavour
635 unless (-f "$authorityserverdir/tab/record.abs") {
636 if (C4::Context->preference("marcflavour") eq "UNIMARC") {
637 system("cp -f $kohadir/etc/zebradb/marc_defs/unimarc/authorities/record.abs $authorityserverdir/tab/record.abs");
638 print "Info: copied record.abs for UNIMARC\n";
640 system("cp -f $kohadir/etc/zebradb/marc_defs/marc21/authorities/record.abs $authorityserverdir/tab/record.abs");
641 print "Info: copied record.abs for USMARC\n";
643 $created_dir_or_file++;
645 unless (-f "$authorityserverdir/tab/sort-string-utf.chr") {
646 system("cp -f $kohadir/etc/zebradb/lang_defs/fr/sort-string-utf.chr $authorityserverdir/tab/sort-string-utf.chr");
647 print "Info: copied sort-string-utf.chr\n";
648 $created_dir_or_file++;
650 unless (-f "$authorityserverdir/tab/word-phrase-utf.chr") {
651 system("cp -f $kohadir/etc/zebradb/lang_defs/fr/sort-string-utf.chr $authorityserverdir/tab/word-phrase-utf.chr");
652 print "Info: copied word-phase-utf.chr\n";
653 $created_dir_or_file++;
655 unless (-f "$authorityserverdir/tab/auth1.att") {
656 system("cp -f $kohadir/etc/zebradb/authorities/etc/bib1.att $authorityserverdir/tab/auth1.att");
657 print "Info: copied auth1.att\n";
658 $created_dir_or_file++;
660 unless (-f "$authorityserverdir/tab/default.idx") {
661 system("cp -f $kohadir/etc/zebradb/etc/default.idx $authorityserverdir/tab/default.idx");
662 print "Info: copied default.idx\n";
663 $created_dir_or_file++;
666 unless (-f "$authorityserverdir/etc/ccl.properties") {
667 # system("cp -f $kohadir/etc/zebradb/ccl.properties ".C4::Context->zebraconfig('authorityserver')->{ccl2rpn});
668 system("cp -f $kohadir/etc/zebradb/ccl.properties $authorityserverdir/etc/ccl.properties");
669 print "Info: copied ccl.properties\n";
670 $created_dir_or_file++;
672 unless (-f "$authorityserverdir/etc/pqf.properties") {
673 # system("cp -f $kohadir/etc/zebradb/pqf.properties ".C4::Context->zebraconfig('authorityserver')->{ccl2rpn});
674 system("cp -f $kohadir/etc/zebradb/pqf.properties $authorityserverdir/etc/pqf.properties");
675 print "Info: copied pqf.properties\n";
676 $created_dir_or_file++;
680 # AUTHORITIES : copying mandatory files
682 unless (-f C4::Context->zebraconfig('authorityserver')->{config}) {
683 open ZD,">:utf8 ",C4::Context->zebraconfig('authorityserver')->{config};
685 # generated by KOHA/misc/migration_tools/rebuild_zebra.pl
686 profilePath:\${srcdir:-.}:$authorityserverdir/tab/:$tabdir/tab/:\${srcdir:-.}/tab/
689 # Files that describe the attribute sets supported.
694 modulePath:$modulesdir/modules/
695 # Specify record type
696 iso2709.recordType:grs.marcxml.record
698 recordId: (auth1,Local-Number)
704 lockDir: $authorityserverdir/lock
707 register: $authorityserverdir/register:4G
708 shadow: $authorityserverdir/shadow:4G
710 # Temp File area for result sets
711 setTmpDir: $authorityserverdir/tmp
713 # Temp File area for index program
714 keyTmpDir: $authorityserverdir/key
716 # Approx. Memory usage during indexing
720 print "Info: creating zebra-authorities.cfg\n";
721 $created_dir_or_file++;
724 if ($created_dir_or_file) {
725 print "Info: created : $created_dir_or_file directories & files\n";
727 print "Info: file & directories OK\n";
732 print "====================\n";
733 print "checking directories & files for biblios\n";
734 print "====================\n";
737 # BIBLIOS : creating directory structure
739 unless (-d "$biblioserverdir") {
740 system("mkdir -p $biblioserverdir");
741 print "Info: created $biblioserverdir\n";
742 $created_dir_or_file++;
744 unless (-d "$biblioserverdir/lock") {
745 mkdir "$biblioserverdir/lock";
746 print "Info: created $biblioserverdir/lock\n";
747 $created_dir_or_file++;
749 unless (-d "$biblioserverdir/register") {
750 mkdir "$biblioserverdir/register";
751 print "Info: created $biblioserverdir/register\n";
752 $created_dir_or_file++;
754 unless (-d "$biblioserverdir/shadow") {
755 mkdir "$biblioserverdir/shadow";
756 print "Info: created $biblioserverdir/shadow\n";
757 $created_dir_or_file++;
759 unless (-d "$biblioserverdir/tab") {
760 mkdir "$biblioserverdir/tab";
761 print "Info: created $biblioserverdir/tab\n";
762 $created_dir_or_file++;
764 unless (-d "$biblioserverdir/key") {
765 mkdir "$biblioserverdir/key";
766 print "Info: created $biblioserverdir/key\n";
767 $created_dir_or_file++;
769 unless (-d "$biblioserverdir/etc") {
770 mkdir "$biblioserverdir/etc";
771 print "Info: created $biblioserverdir/etc\n";
772 $created_dir_or_file++;
776 # BIBLIOS : copying mandatory files
778 # the record model, depending on marc flavour
779 unless (-f "$biblioserverdir/tab/record.abs") {
780 if (C4::Context->preference("marcflavour") eq "UNIMARC") {
781 system("cp -f $kohadir/etc/zebradb/marc_defs/unimarc/biblios/record.abs $biblioserverdir/tab/record.abs");
782 print "Info: copied record.abs for UNIMARC\n";
784 system("cp -f $kohadir/etc/zebradb/marc_defs/marc21/biblios/record.abs $biblioserverdir/tab/record.abs");
785 print "Info: copied record.abs for USMARC\n";
787 $created_dir_or_file++;
789 unless (-f "$biblioserverdir/tab/sort-string-utf.chr") {
790 system("cp -f $kohadir/etc/zebradb/lang_defs/fr/sort-string-utf.chr $biblioserverdir/tab/sort-string-utf.chr");
791 print "Info: copied sort-string-utf.chr\n";
792 $created_dir_or_file++;
794 unless (-f "$biblioserverdir/tab/word-phrase-utf.chr") {
795 system("cp -f $kohadir/etc/zebradb/lang_defs/fr/sort-string-utf.chr $biblioserverdir/tab/word-phrase-utf.chr");
796 print "Info: copied word-phase-utf.chr\n";
797 $created_dir_or_file++;
799 unless (-f "$biblioserverdir/tab/bib1.att") {
800 system("cp -f $kohadir/etc/zebradb/biblios/etc/bib1.att $biblioserverdir/tab/bib1.att");
801 print "Info: copied bib1.att\n";
802 $created_dir_or_file++;
804 unless (-f "$biblioserverdir/tab/default.idx") {
805 system("cp -f $kohadir/etc/zebradb/etc/default.idx $biblioserverdir/tab/default.idx");
806 print "Info: copied default.idx\n";
807 $created_dir_or_file++;
809 unless (-f "$biblioserverdir/etc/ccl.properties") {
810 # system("cp -f $kohadir/etc/zebradb/ccl.properties ".C4::Context->zebraconfig('biblioserver')->{ccl2rpn});
811 system("cp -f $kohadir/etc/zebradb/ccl.properties $biblioserverdir/etc/ccl.properties");
812 print "Info: copied ccl.properties\n";
813 $created_dir_or_file++;
815 unless (-f "$biblioserverdir/etc/pqf.properties") {
816 # system("cp -f $kohadir/etc/zebradb/pqf.properties ".C4::Context->zebraconfig('biblioserver')->{ccl2rpn});
817 system("cp -f $kohadir/etc/zebradb/pqf.properties $biblioserverdir/etc/pqf.properties");
818 print "Info: copied pqf.properties\n";
819 $created_dir_or_file++;
823 # BIBLIOS : copying mandatory files
825 unless (-f C4::Context->zebraconfig('biblioserver')->{config}) {
826 open ZD,">:utf8 ",C4::Context->zebraconfig('biblioserver')->{config};
828 # generated by KOHA/misc/migrtion_tools/rebuild_zebra.pl
829 profilePath:\${srcdir:-.}:$biblioserverdir/tab/:$tabdir/tab/:\${srcdir:-.}/tab/
832 # Files that describe the attribute sets supported.
837 modulePath:$modulesdir/modules/
838 # Specify record type
839 iso2709.recordType:grs.marcxml.record
841 recordId: (bib1,Local-Number)
847 lockDir: $biblioserverdir/lock
850 register: $biblioserverdir/register:4G
851 shadow: $biblioserverdir/shadow:4G
853 # Temp File area for result sets
854 setTmpDir: $biblioserverdir/tmp
856 # Temp File area for index program
857 keyTmpDir: $biblioserverdir/key
859 # Approx. Memory usage during indexing
863 print "Info: creating zebra-biblios.cfg\n";
864 $created_dir_or_file++;
867 if ($created_dir_or_file) {
868 print "Info: created : $created_dir_or_file directories & files\n";
870 print "Info: file & directories OK\n";