Оновлення Koha, встановленої з джерела

Версія від 18:44, 3 березня 2013, створена Dubyk (обговореннявнесок) (Продовжуємо оновлення через веб-інтерфейс)

Оновлення до Koha 3.10.x, встановленої з джерела

Стосується встановлення Koha 3.10.x за інструкцією „Встановлення Koha з джерела на ОС Debian“

Зміст

Резервні копії

Резервування даних

Резервуємо командою

mysqldump -u$MySQLUser -p$MySQLPassword $KohaDB > mysqldump__$time_shtamp.sql

(замість змінних $value підставляємо власні значення)

Резервування програмних файлів

Виконуємо команди

tar -cvf $folder_$time_shtamp.tar $folder
bzip2 -f $folder_$time_shtamp.tar

для кожної з тек

/usr/share/koha3
/etc/apache2/sites-available/Koha3
/etc/apache2/sites-enabled/Koha3
/etc/apache2/ports.conf
/etc/koha3/
/etc/init.d/zebra-server
/etc/init.d/zebraqueue-daemon
/etc/init.d/koha-zebra-daemon
/var/log/koha3
/var/lib/koha3
/var/lock/koha3

Журнал попереднього встановлення

Дивимося у конфігураційному файлі /etc/koha3/koha-conf.xml за розміщенням журналу встановлення, напр. <config> <install_log>/usr/share/koha3/misc/koha-install-log</install_log>

Отримання останньої стабільної версій Koha 3.10.3

su АдміністраторСистемиKoha

(та вводимо пароль користувача АдміністраторСистемиKoha)

cd ~/koha;

rm koha-latest.tar.gz
wget http://download.koha-community.org/koha-latest.tar.gz
tar -xzf koha-latest.tar.gz
ls

Оновлення

cd ~/koha/koha-3.10.03/
perl Makefile.PL --prev-install-log /usr/share/koha3/misc/koha-install-log

у випадку оновлення 3.6-3.10 з’явилася можливість налаштувати Zebra для кращої підтримки Unicode-символів. Вибираємо icu:

Zebra has two methods to perform records tokenization
and characters normalization: CHR and ICU. ICU is
recommended for catalogs containing non-Latin
characters. (chr, icu) [chr] icu

у випадку оновлення 3.8.2-3.8.3 з’явився більш прогресивний режим індексації Zebra за допопогою фільтра DOM XML. Вибираємо dom:

Koha can use one of  two different indexing modes
for the MARC bibliographic records:

grs1 - uses the Zebra GRS-1 filter, available
       for legacy support
dom  - uses the DOM XML filter; offers improved
       functionality.

Bibliographic indexing mode (dom, grs1) [dom] 

решту запитань —

Reading values from install log /usr/share/koha3/misc/koha-install-log.  You
will be prompted only for settings that have been
added since the last time you installed Koha.  To
be prompted for all settings, run 'perl Makefile.PL'
without the --prev-install-log option.

Found 'zebrasrv' and 'zebraidx' in /usr/bin.

Koha will be installed with the following configuration parameters:

AUTH_INDEX_MODE          dom
BIB_INDEX_MODE           dom
DB_HOST                  localhost
DB_NAME                  Koha3
DB_PASS                  ПарольКористувачаБДKoha3
DB_PORT                  3306
DB_TYPE                  mysql
DB_USER                  КористувачБДKoha3
INSTALL_BASE             /usr/share/koha3
INSTALL_MODE             standard
INSTALL_PAZPAR2          yes
INSTALL_SRU              yes
INSTALL_ZEBRA            yes
KOHA_GROUP               АдміністраторСистемиKoha
KOHA_INSTALLED_VERSION   3.10.03.000
KOHA_USER                АдміністраторСистемиKoha
MEMCACHED_NAMESPACE      KOHA
MEMCACHED_SERVERS        127.0.0.1:11211
MERGE_SERVER_HOST        localhost
MERGE_SERVER_PORT        11001
PATH_TO_ZEBRA            /usr/bin
PAZPAR2_HOST             localhost
PAZPAR2_PORT             11002
RUN_DATABASE_TESTS       no
USE_MEMCACHED            yes
ZEBRA_LANGUAGE           uk
ZEBRA_MARC_FORMAT        unimarc
ZEBRA_PASS               ПарольКористувачаZebra
ZEBRA_SRU_AUTHORITIES_POR9999
ZEBRA_SRU_BIBLIOS_PORT   9998
ZEBRA_SRU_HOST           localhost
ZEBRA_TOKENIZER          icu
ZEBRA_USER               КористувачZebra

and in the following directories:

DOC_DIR                  $(DESTDIR)/usr/share/koha3/doc
INTRANET_CGI_DIR         $(DESTDIR)/usr/share/koha3/intranet/cgi-bin
INTRANET_TMPL_DIR        $(DESTDIR)/usr/share/koha3/intranet/htdocs/intranet-tmpl
INTRANET_WWW_DIR         $(DESTDIR)/usr/share/koha3/intranet/htdocs
KOHA_CONF_DIR            $(DESTDIR)/etc/koha3
LOG_DIR                  $(DESTDIR)/var/log/koha3
MAN_DIR                  $(DESTDIR)/usr/share/koha3/man
MISC_DIR                 $(DESTDIR)/usr/share/koha3/misc
OPAC_CGI_DIR             $(DESTDIR)/usr/share/koha3/opac/cgi-bin
OPAC_TMPL_DIR            $(DESTDIR)/usr/share/koha3/opac/htdocs/opac-tmpl
OPAC_WWW_DIR             $(DESTDIR)/usr/share/koha3/opac/htdocs
PAZPAR2_CONF_DIR         $(DESTDIR)/etc/koha3/pazpar2
PERL_MODULE_DIR          $(DESTDIR)/usr/share/koha3/lib
SCRIPT_DIR               $(DESTDIR)/usr/share/koha3/bin
SCRIPT_NONDEV_DIR        $(DESTDIR)/usr/share/koha3/bin
ZEBRA_CONF_DIR           $(DESTDIR)/etc/koha3/zebradb
ZEBRA_DATA_DIR           $(DESTDIR)/var/lib/koha3/zebradb
ZEBRA_LOCK_DIR           $(DESTDIR)/var/lock/koha3/zebradb
ZEBRA_RUN_DIR            $(DESTDIR)/var/run/koha3/zebradb

To change any configuration setting, please run
perl Makefile.PL again.  To override one of the target
directories, you can do so on the command line like this:

perl Makefile.PL PERL_MODULE_DIR=/usr/share/perl/5.8

You can also set different default values for parameters
or override directory locations by using environment variables.

For example:

export DB_USER=my_koha
perl Makefile.PL

or

DB_USER=my_koha DOC_DIR=/usr/local/info perl Makefile.PL

If installing on a Win32 platform, be sure to use:
'dmake -x MAXLINELENGTH=300000'

Writing Makefile for koha

Якщо у попередньому виводі є зауваження на кшталт такого

Warning: prerequisite DateTime::Format::DateParse 0.04 not found.
Warning: prerequisite Gravatar::URL 1.03 not found.
Warning: prerequisite DateTime::Format::ICal 0.09 not found.
Warning: prerequisite Modern::Perl 1.03 not found.
Warning: prerequisite Readonly 1.03 not found.
Warning: prerequisite Readonly::XS 1.02 not found.
Warning: prerequisite Test::Strict  not found.
Warning: prerequisite Test::YAML::Valid 0.04 not found.
Warning: prerequisite AnyEvent 5.0 not found.
Warning: prerequisite AnyEvent::HTTP 2.13 not found.
Warning: prerequisite CHI 0.36 not found.
Warning: prerequisite CHI::Driver::Memcached 0.12 not found.
Warning: prerequisite Moose 1.09 not found.
Warning: prerequisite Cache::Memcached::Fast 0.17 not found.
Warning: prerequisite DBD::Mock 1.39 not found.
Warning: prerequisite DateTime::Format::MySQL 0.04 not found.
Warning: prerequisite JSON::Any 1.28 not found.
Warning: prerequisite MooseX::Storage 0.30 not found.
Warning: prerequisite MooseX::Types 0.30 not found.
Warning: prerequisite String::RewritePrefix 0.006 not found.
Warning: prerequisite Test::Deep 0.106 not found.
Warning: prerequisite Test::MockModule 0.05 not found.
Warning: prerequisite Test::Warn 0.21 not found.
Warning: prerequisite Text::Unaccent 1.08 not found.
Warning: prerequisite Time::Progress 1.7 not found.

Пакунки з репозитарію Дебіен

то необхідно довстановити згадані пакунки:

sudo apt-get install \
libgravatar-url-perl \
libdatetime-format-ical-perl \
libmodern-perl-perl \
libdatetime-format-dateparse-perl \
libreadonly-perl \
libreadonly-xs-perl \
libtest-strict-perl \
libtest-yaml-valid-perl \
libanyevent-perl \
libdbd-mock-perl \
libdatetime-format-mysql-perl \
libjson-any-perl \
libmoosex-storage-perl \
libmoosex-types-perl \
libstring-rewriteprefix-perl \
libtest-deep-perl \
libtest-mockmodule-perl \
libtest-warn-perl \
libtext-unaccent-perl \
libtime-progress-perl

Пакунки з тестового репозитарію Дебіен

Може бути й зауваження такого роду:

Warning: prerequisite Gravatar::URL 1.03 not found. We have 1.02.
Warning: prerequisite DateTime::TimeZone 1.26 not found. We have 1.20.

Це означає, що у Вашій версії Debian цей пакунок є але версія нижче ніж необхідно. Тоді довстановлюємо з репозитарію „testing“ (чи „unstable“):

sudo apt-get -t testing install libgravatar-url-perl 
sudo apt-get -t testing install libdatetime-timezone-perl
sudo apt-get -t testing install libtemplate-plugin-htmltotext-perl
sudo apt-get -t testing install libanyevent-http-perl 
sudo apt-get -t testing install libchi-perl
sudo apt-get -t testing install libchi-driver-memcached-perl
sudo apt-get -t testing install libmouse-perl
sudo apt-get -t testing install libcache-memcached-fast-perl

однак, якщо наявні помилки, пробуємо встановити конкретні версії пакунків:

sudo apt-get install libgravatar-url-perl=1.06-1
sudo apt-get install libdatetime-timezone-perl=1:1.46-1+2012c libclass-load-perl=0.17-1 libmodule-implementation-perl=0.06-1 libmodule-runtime-perl=0.013-1 libpackage-stash-perl=0.33-1

Пакунки з репозитарію Koha

Деякі perl-пакунки ще не пакетизовані в офіційних репозитаріях Дебіен. Однак відповідні deb-пакунки можна знайти в репозитарії debian.koha-community.org.

Підключаємо у файлі /etc/apt/sources.list

deb http://debian.koha-community.org/koha squeeze main
   

Також додаємо ключ gpg.asc до довірених ключів APT:

wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -

Оновлюємо список доступних для встановлення пакунків

apt-get update

Наприклад, можуть бути й зауваження такого роду:

Warning: prerequisite Template::Plugin::HtmlToText 0.03 not found.
Warning: prerequisite Data::Paginator 0.04 not found.

Ці Perl-модулі ще не доступні у репозиторії Дебіен (перевірити libdata-paginator-perl та libtemplate-plugin-htmltotext-perl). Але є у репозиторії http://debian.koha-community.org, звантажуємо і встановлюємо

Пакунки з репозитарію Koha

sudo apt-get install libdata-paginator-perl
sudo apt-get install libtemplate-plugin-htmltotext-perl

Пакунки з CPAN

Якщо пакунок все таки не вдалося знайти в одному з репозитаріїв — встановлюємо з CPAN.

Наприклад, можуть бути й зауваження такого роду:

Warning: prerequisite Data::Pagination 0.44 not found.

Цей Perl-модуль ще не доступний в жодному з репозиторіїв Дебіен (перевірити в Debian: libdata-pagination-perl). Встановлюємо командою

sudo  perl -MCPAN -e 'install Data::Pagination'

Продовження встановлення

Також знову виконуємо

perl Makefile.PL --prev-install-log /usr/share/koha3/misc/koha-install-log

Компіляція та встановлення

make
make test
sudo make upgrade

Поправити налаштування хоста Apache

sudo mc -e /etc/koha3/koha-httpd.conf
/etc/koha3/koha-httpd.conf

...
<VirtualHost *:80>
  ServerName koha
...
...
<VirtualHost *:8888>
  ServerName koha:8888
...

та перезапустити сервер Apache

sudo /etc/init.d/apache2 restart

Куки

Інколи при оновленні між версіями, при спробі доступу до веб-інтерфейсу з’являється у оглядачі помилка на зразок

Koha Byte order is not compatible at Storable.pm line  Auth.pm 

Вирішує проблему очищення куків в оглядачі для даного домену.

Продовжуємо оновлення через веб-інтерфейс

http://localhost:8888

Логін АдміністраторСистемиKoha та пароль

Update report :

   Upgrade to 3.09.00.001 done. (Bug 8002: Update patron attribute types table to allow NULL category_code)
   Upgrade to 3.09.00.002 done (Added cache_expiry and public fields in
   saved_reports table.)
   Upgrade to 3.09.00.003 done (Added SvcMaxReportRows syspref)
   Upgrade to 3.09.00.004 done (Adds permissions flag for access to the patron modifications tool)
   Upgrade to 3.09.00.005 done (Adding Quote of the Day Option.)
   Upgrade to 3.09.00.006 done (Changed system preference OPACDisplayRequestPriority -> OPACShowHoldQueueDetails)
   Upgrade to 3.09.00.007 done (Insert ReservesControlBranch systempreference into systempreferences table )
   Upgrade to 3.09.00.008 done (redefine the field id as PRIMARY KEY of sessions)
   Upgrade to 3.09.00.009 done (redefine the field branchcode as PRIMARY KEY of branches)
   Upgrade to 3.09.00.010 done (Add system preference issuelostitem ))
   Upgrade to 3.09.00.011 done (Adding ean in biblioitems and deletedbiblioitems)
   If you have records with ean, please run misc/batchRebuildBiblioTables.pl to populate bibliotems.ean
   Upgrade to 3.09.00.012 done (Add system preference OpacBrowseResults ))
   Upgrade to 3.09.00.013 done (Add system preference DefaultLanguageField008))
   Upgrade done (Support for Talking Tech i-tiva phone notification system)
   Upgrade to 3.09.00.015 done (Add System preference StatisticsFields)
   Upgrade to 3.09.00.016 done (Add syspref OPACShowBarcode)
   Upgrade to 3.09.00.017 done (Add customizable OpacNavRight region to the OPAC main page)
   Upgrade to 3.09.00.018 done (Add aqbudgetborrowers table)
   Upgrade to 3.09.00.019 done (Add OPACShowUnusedAuthorities system preference)
   Upgrade to 3.09.00.020 done (Added borrow_files table, EnableBorrowerFiles syspref)
   Upgrade to 3.09.00.021 done (Add syspref UpdateTotalIssuesOnCirc)
   Upgrade to 3.09.00.022 done (Change search_history.query_cgi type to text. bug 5981)
   Upgrade to 3.09.00.023 done (Add system preference SearchEngine )
   Upgrade to 3.09.00.024 done (Add system preference IntranetSlipPrinterJS))
   Upgrade to 3.09.00.025 done (add reserve_id to reserves & old_reserves tables)
   Upgrade to 3.09.00.026 done (Added parameters subpermissions)
   Upgrade to 3.09.00.027 done (Bug 7420 add overduefinescap to circulation matrix)
   Upgrade to 3.09.00.028 done (Add thesaurus links for MARC21/NORMARC)
   Upgrade to 3.09.00.029 done (Add itemBarcodeInputFilter choice EAN13)
   Upgrade to 3.09.00.029 done ( Added EAN13 barcode autogeneration sequence )
   Upgrade to 3.09.00.030 done (BZ 8263: Make OPAC stylesheet preferences more consistent)
   Upgrade to 3.09.00.031 done ('Remove preferences controlling broken Amazon features (Bug 8679')
   Upgrade to 3.09.00.032 done (Bug 8657 - Default sort by call number does not work. Correcting system preference value.)
   Upgrade to 3.09.00.033 done (Add OpacSuppressionByIPRange syspref)
   Upgrade to 3.09.00.034 done (Bug 8207: correct typo in authority types)
   Upgrade to 3.09.00.035 done (Adding PrefillItem and SubfieldsToUseWhenPrefill sysprefs)
   Upgrade to 3.09.00.036 done (Add colum agerestriction to biblioitems and deletedbiblioitems, add system preferences AgeRestrictionMarker and AgeRestrictionOverride)
   Upgrade to 3.09.00.037 done (creating `transport_cost` table; adding UseTransportCostMatrix systempref, in circulation)
   Upgrade to 3.09.00.038 done (Increase the maximum size of a borrower attribute value)
   Upgrade to 3.09.00.039 done (Add system preference DidYouMeanFromAuthorities)
   Upgrade to 3.09.00.040 done (Add IncludeSeeFromInSearches system preference)
   Upgrade to 3.09.00.041 done (Add system preference ExportRemoveFields)
   Upgrade to 3.09.00.042 done (Adds New System preference ExportWithCsvProfile)
   Upgrade to 3.09.00.043 done (Adding parent_ordernumber in aqorders)
   Upgrade done ( Added Collection Code to Statistics table. )
   Upgrade to 3.09.00.045 done. (Bug 8002: Update patron attribute types table from varchar(1) to varchar(10) category_code)
   Warning to Koha System Administrators: If you use borrower attributes defined by borrower categories, you have to check your configuration. A bug may have removed your attribute links to borrower categories.
   Please check, and fix it if necessary.Upgrade to 3.09.00.046 done (adding accountlines_id field in accountlines table)
   Upgrade to 3.09.00.047 done: adding AllowReturnToBranch syspref (bug 6151)Upgrade to 3.09.00.048 done (Raise the length of Authorised Values descriptions)
   Upgrade to 3.09.00.049 done (Add OPACMobileUserCSS, OpacMainUserBlockMobile, OpacShowLibrariesPulldownMobile and OpacShowFiltersPulldownMobile sysprefs)
   Upgrade to 3.09.00.050 done saved_sql new fields report_group and report_area; authorised_values.category 16 char
   Upgrade to 3.09.00.051 done (Add aqinvoices table)
   Upgrade to 3.09.00.052 done (Add systempreferences to decrease loan length on high demand items decreaseLoanHighHolds, decreaseLoanHighHoldsValue and decreaseLoanHighHoldsDuration)
   Upgrade to 3.09.00.053 done (Added support for staging authorities)
   Upgrade to 3.09.00.054 done (Change column name in aqorders gst --> gstrate)
   Upgrade to 3.09.00.055 done (Add discount field in aqorders table)
   Upgrade to 3.09.00.056 done (Add system preference AuthDisplayHierarchy)
   Upgrade to 3.09.00.057 done (Bug 5356: Added billingplace, deliveryplace to the aqbasket table)
   Upgrade to 3.09.00.058 done (Add Did You Mean? configuration)
   Upgrade to 3.09.00.059 done (Add system preference BlockReturnOfWithdrawnItems)
   Upgrade to 3.09.00.060 done (Added HoldsToPullStartDate syspref)
   Upgrade to 3.09.00.061 done (Fixes Bug 5409, Set the syspref value to 1 if it is itemdetails and 0 if it is statuses, leaving it alone if it is already 1 or 0 and change the type of the syspref to YesNo.)
   Upgrade to 3.09.00.062 done (Disable obsolete NoZebra and QueryRemoveStopwords sysprefs)
   Upgrade to 3.09.00.063 done (Bug 8832, Set the syspref gist with the existing values)
   Upgrade to 3.09.00.064 done (Bug 6428: Added coded_location_qualifier to the items table)
   Upgrade to 3.09.00.065 done (Bug 6428: Added coded_location_qualifier to the deleteditems table)
   Upgrade to 3.09.00.066 done (Bug 9107: remove DidYouMeanFromAuthorities syspref)
   Upgrade to 3.09.00.067 done (Bug 9064: statistics.ccode potentially wrongly defined)
   Upgrade to 3.10.00.000 done (release tag)
   Upgrade to 3.10.01.000 done (3.10.1 release)
   Upgrade to 3.10.02.000 done (3.10.2 release)
   Upgrade to 3.10.02.001 done (Bug 9382 - refresh permission descriptions to make more sense)
   Upgrade to 3.10.02.002 done (Bug 9145 - Add syspref UNIMARCAuthorityField100)
   Upgrade to 3.10.03.000 done (3.10.3 release)

Update errors :

   [Sun Mar 3 17:39:08 2013] updatedatabase.pl: DBD::mysql::db do failed: Duplicate entry 'SuspendHoldsIntranet' for key 'PRIMARY' at /usr/share/koha3/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 5335.
   [Sun Mar 3 17:39:08 2013] updatedatabase.pl: DBD::mysql::db do failed: Duplicate entry 'SuspendHoldsOpac' for key 'PRIMARY' at /usr/share/koha3/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 5336.

Поновлення мовних шаблонів

Шаблони для мов відмінних від en залишаються старі — необхідно теж оновити, напр. для укр. та рос.:

cd /usr/share/koha3/misc/translator/;sudo env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib "./translate" install uk-UA
cd /usr/share/koha3/misc/translator/;sudo env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib "./translate" install ru-RU

Бажано після цього перезапустити й службу memcached

sudo /etc/init.d/memcached restart

Відновлення Zebra

Поновлювач перезаписує файл

/etc/koha3/zebradb/etc/word-phrase-utf.chr

витираючи набори кириличних символів й опостроф, необхідні для працездатності пошуку Zebra, отож виправляємо у цьому файлі на наступне:

lowercase {0-9}{a-z}æäåąßćęłńóśøöüźżабвгдежзийклмнопрстуфхцчшщьыъэюяёєїґўі’
uppercase {0-9}{A-Z}ÆÄÅĄẞĆĘŁŃÓŚØÖÜŹŻАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯЁЄЇҐЎІ’

space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~{\x88-\x89}{\x98-\x9C}

Зауваження: при виборі ICU цього не потрібно (ще варто детально протестувати)

Переіндексація БД

sudo -u koha3admin env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib \
 /usr/share/koha3/bin/migration_tools/rebuild_zebra.pl -b -r -x -v
     
sudo -u koha3admin env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib \
 /usr/share/koha3/bin/migration_tools/rebuild_zebra.pl -a -r -v

Зауваження щодо ICU

Використання ICU, ймовірно, ще потребує дослідження. На великій БД з'явилась помилка при переіндесації Zebra:

...
*** glibc detected *** zebraidx: corrupted double-linked list: 0x09d57700 ***
...

Згадки по цій проблемі: http://lists.nongnu.org/archive/html/koha-zebra/2011-06/msg00001.html http://irc.koha-community.org/irclog/koha/2011-05-29

Відключити ICU можна у файлі /etc/koha3/zebradb/etc/default.idx, замінивши у двох рядках

icuchain words-icu.xml

на

charmap word-phrase-utf.chr

Також у файлі /etc/koha3/zebradb/etc/word-phrase-utf.chr повинен бути кириличний алфавіт (згадується вище).

Відновлення алфавітного вибору читачів

У файлі intranet/cgi-bin/members/member.pl виправити

my @letters = map { {letter => $_} } ( 'A' .. 'Z');

на

my @letters = map { {letter => $_} } (
'А','Б','В','Г','Ґ','Д','Е','Є','Ж','З','И','І','Ї','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ь','Ю',
'Я','</a>…<a>','Ў','Ё','Ъ','Ы','Э','</a>…<a>',
'A' .. 'Z');

Також у файлі intranet/cgi-bin/members/members-home.pl виправити

my @letters = map { {letter => $_} } ( 'A' .. 'Z');

на

my @letters = map { {letter => $_} } (
'А','Б','В','Г','Ґ','Д','Е','Є','Ж','З','И','І','Ї','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ь','Ю',
'Я','</a>…<a>','Ў','Ё','Ъ','Ы','Э','</a>…<a>',
'A' .. 'Z');

Відновлення індексування УДК в Zebra

Кроки:

1) У файлі /etc/koha3/zebradb/biblios/etc/bib1.att вже є необхідний рядок

att 14    UDC-classification

2) У файлі /etc/koha3/zebradb/ccl.properties знаходимо абзац

#Classification-UDC     14  A classification number from    080
#                           Universal Decimal
#                           Classification, a system based
#                           on the Dewey Decimal
#                           Classification.
#UDC-classification 1=14

та розкоментовуємо

UDC-classification 1=14

3) Далі для Unimarc у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/record.abs потрібно додати

melm 675$a      UDC-classification:w,UDC-classification:p

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

у файл /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl додати

     <xslo:template mode="index_subfields" match="marc:datafield[@tag='675']">
       <xslo:for-each select="marc:subfield">
         <xslo:if test="contains('a', @code)">
           <z:index name="UDC-classification:w UDC-classification:p">
             <xslo:value-of select="."/>
           </z:index>
         </xslo:if>
       </xslo:for-each>
     </xslo:template>

та у файл /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml додати

     <------>UDC-classification:w,UDC-classification:p-->
     <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="675" subfields="a">
       <target_index>UDC-classification:w</target_index>
       <target_index>UDC-classification:p</target_index>
     </index_subfields>

Далі для Marc21 у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/record.abs:

melm 080        UDC-classification:w,UDC-classification:s

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl має бути (є)

  <xslo:template mode="index_data_field" match="marc:datafield[@tag='080']">
   <z:index name="UDC-classification:w UDC-classification:s">
     <xslo:variable name="raw_heading">
       <xslo:for-each select="marc:subfield">
         <xslo:if test="position() > 1">
           <xslo:value-of select="substring(' ', 1, 1)"/>
         </xslo:if>
         <xslo:value-of select="."/>
       </xslo:for-each>
     </xslo:variable>
     <xslo:value-of select="normalize-space($raw_heading)"/>
   </z:index>
 </xslo:template>

та у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml має бути (є)

<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="080">
  <target_index>UDC-classification:w</target_index>
  <target_index>UDC-classification:s</target_index>
</index_data_field>

4) Також потрібно у файлі /usr/share/koha3/lib/C4/Search.pm у масив @indexes додати елемент-індекс

'UDC-classification',

Відновлення індексування ББК в Zebra

Кроки:

1) У файлі /etc/koha3/zebradb/biblios/etc/bib1.att є рядок

att 1040    Classification

Виглядає так, що він не використовується надалі. Отож замінюємо його на такий

att 1040    bbk

2) У файлі /etc/koha3/zebradb/ccl.properties повинен бути наступний рядок

#bbk     1040  Soviet Bibliothecal-Bibliographic Classification (BBK; LBC)
bbk 1=1040

3) Далі для Unimarc у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/record.abs потрібно додати

melm 686$a      bbk,bbk:p

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

у файл /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl додати

<xslo:template mode="index_subfields" match="marc:datafield[@tag='686']">
  <xslo:for-each select="marc:subfield">
    <xslo:if test="contains('a', @code)">
      <z:index name="bbk bbk:p">
        <xslo:value-of select="."/>
      </z:index>
    </xslo:if>
  </xslo:for-each>
</xslo:template>

та у файл /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml додати

<------>bbk,bbk:p-->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="686" subfields="a">
  <target_index>bbk</target_index>
  <target_index>bbk:p</target_index>
</index_subfields>

Далі для Marc21 у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/record.abs:

melm 084        bbk:w,bbk:s

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl має бути (є)

  <xslo:template mode="index_data_field" match="marc:datafield[@tag='084']">
   <z:index name="bbk:w bbk:s">
     <xslo:variable name="raw_heading">
       <xslo:for-each select="marc:subfield">
         <xslo:if test="position() > 1">
           <xslo:value-of select="substring(' ', 1, 1)"/>
         </xslo:if>
         <xslo:value-of select="."/>
       </xslo:for-each>
     </xslo:variable>
     <xslo:value-of select="normalize-space($raw_heading)"/>
   </z:index>
 </xslo:template>

та у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml має бути (є)

<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="084">
  <target_index>bbk:w</target_index>
  <target_index>bbk:s</target_index>
</index_data_field>

4) Також потрібно у файлі /usr/share/koha3/lib/C4/Search.pm у масив @indexes додати елемент-індекс

'bbk',

Відновлення індексування ДКД (Дьюї) в Zebra

Кроки:

1) У файлі /etc/koha3/zebradb/biblios/etc/bib1.att вже є необхідний рядок

att 13    Dewey-classification

2) У файлі /etc/koha3/zebradb/ccl.properties находимо абзац

#Classification-Dewey   13  A classification number from    082
#                           the Dewey Decimal
#                           Classification, developed by
#                           Melvyl Dewey.
#Dewey-classification 1=13

та розкоментовуємо

Dewey-classification 1=13

3) Далі для Unimarc у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/record.abs повинно бути (є)

melm 676$a      Dewey-classification,Dewey-classification:p

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl має бути (є)

 <xslo:template mode="index_subfields" match="marc:datafield[@tag='676']">
   <xslo:for-each select="marc:subfield">
     <xslo:if test="contains('a', @code)">
       <z:index name="Dewey-classification Dewey-classification:p">
         <xslo:value-of select="."/>
       </z:index>
     </xslo:if>
   </xslo:for-each>
 </xslo:template>

та у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml має бути (є)

 Dewey-classification,Dewey-classification:p-->
 <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="676" subfields="a">
   <target_index>Dewey-classification</target_index>
   <target_index>Dewey-classification:p</target_index>
 </index_subfields>

Далі для Marc21 у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/record.abs:

melm 082        Dewey-classification:w,Dewey-classification:s

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

Додаково внести зміни й у /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl:

<xslo:template mode="index_data_field" match="marc:datafield[@tag='082']">
   <z:index name="Dewey-classification:w Dewey-classification:s">
     <xslo:variable name="raw_heading">
       <xslo:for-each select="marc:subfield">
         <xslo:if test="position() > 1">
           <xslo:value-of select="substring(' ', 1, 1)"/>
         </xslo:if>
         <xslo:value-of select="."/>
       </xslo:for-each>
     </xslo:variable>
     <xslo:value-of select="normalize-space($raw_heading)"/>
   </z:index>
 </xslo:template>

та /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml:

<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="082">
 <target_index>Dewey-classification:w</target_index>
 <target_index>Dewey-classification:s</target_index>
</index_data_field>

4) Також потрібно у файлі /usr/share/koha3/lib/C4/Search.pm у масиві @indexes має бути (є) елемент-індекс

'Dewey-classification',

Відновлення індексування КБК (клас. Бібліотеки Конгресу) в Zebra

Кроки:

1) У файлі /etc/koha3/zebradb/biblios/etc/bib1.att вже є необхідний рядок

att 16    LC-call-number

2) У файлі /etc/koha3/zebradb/ccl.properties находимо абзац

#Classification-LC      16  A classification number from    050
#                           the US Library of Congress
#                           Classification.
#LC-call-number 1=16

та розкоментовуємо

LC-call-number 1=16

3) Далі для Unimarc у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/record.abs повинно бути (є)

melm 680$b    LC-call-number:s
melm 680      LC-call-number

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl має бути (є)

<xslo:template mode="index_subfields" match="marc:datafield[@tag='680']">
   <xslo:for-each select="marc:subfield">
     <xslo:if test="contains('b', @code)">
       <z:index name="LC-call-number:s">
         <xslo:value-of select="."/>
       </z:index>
     </xslo:if>
   </xslo:for-each>
</xslo:template>

<xslo:template mode="index_data_field" match="marc:datafield[@tag='680']">
   <z:index name="LC-call-number:w">
     <xslo:variable name="raw_heading">
       <xslo:for-each select="marc:subfield">
         <xslo:if test="position() > 1">
           <xslo:value-of select="substring(' ', 1, 1)"/>
         </xslo:if>
          <xslo:value-of select="."/>
       </xslo:for-each>
     </xslo:variable>
     <xslo:value-of select="normalize-space($raw_heading)"/>
   </z:index>
</xslo:template>

та у файлі /etc/koha3/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml має бути (є)

<------>LC-call-number:s-->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="680" subfields="b">
  <target_index>LC-call-number:s</target_index>
</index_subfields>
<------>LC-call-number-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="680">
  <target_index>LC-call-number:w</target_index>
</index_data_field>

Далі для Marc21 у файлі /etc/koha3/zebradb/marc_defs/marc21/biblios/record.abs:

melm 050$b      LC-call-number:w,LC-call-number:p,LC-call-number:s
melm 050        LC-call-number:w,LC-call-number:p,LC-call-number:s

Ймовірно, що record.abs застарілий і тепер потрібно вносити зміни в XSL-файли...

Додаково внести зміни й у /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl:

<xslo:template mode="index_subfields" match="marc:datafield[@tag='050']">
  <xslo:for-each select="marc:subfield">
    <xslo:if test="contains('b', @code)">
      <z:index name="LC-call-number:w LC-call-number:p LC-call-number:s">
        <xslo:value-of select="."/>
      </z:index>
    </xslo:if>
  </xslo:for-each>
</xslo:template>

<xslo:template mode="index_data_field" match="marc:datafield[@tag='050']">
  <z:index name="LC-call-number:w LC-call-number:p LC-call-number:s">
    <xslo:variable name="raw_heading">
      <xslo:for-each select="marc:subfield">
        <xslo:if test="position() > 1">
          <xslo:value-of select="substring(' ', 1, 1)"/>
        </xslo:if>
        <xslo:value-of select="."/>
      </xslo:for-each>
    </xslo:variable>
    <xslo:value-of select="normalize-space($raw_heading)"/>
  </z:index>
</xslo:template>

та /etc/koha3/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml:

<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="050" subfields="b">
  <target_index>LC-call-number:w</target_index>
  <target_index>LC-call-number:p</target_index>
  <target_index>LC-call-number:s</target_index>
</index_subfields>
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="050">
  <target_index>LC-call-number:w</target_index>
  <target_index>LC-call-number:p</target_index>
  <target_index>LC-call-number:s</target_index>
</index_data_field>

4) Також потрібно у файлі /usr/share/koha3/lib/C4/Search.pm у масиві @indexes має бути (є) елемент-індекс

'LC-call-number',

Утворення індексів УДК, Дьюї, ББК, КБК та можливість пошуку за ними

Для витягнення означених класифікаційних індексів запускаємо переіндексацію Zebra

sudo -u koha3admin env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib \
   /usr/share/koha3/bin/migration_tools/rebuild_zebra.pl -b -r -x -v

ЕК) У файлі /usr/share/koha3/opac/htdocs/opac-tmpl/prog/en/modules/opac-advsearch.tt

замість рядка

<option value="callnum">Call number</option>

додати рядки

<option value="sn">Standart number</option>
<option value="callnum">     Call number</option>
<option value="UDC-classification,first-in-subfield">     UDC-classification</option>
<option value="Dewey-classification,first-in-subfield">     Dewey-classification</option>
<option value="bbk,first-in-subfield">     BBK</option>
<option value="LC-call-number,first-in-subfield">     LC-call-number</option>

Біб. інтерфейс) У файлі /usr/share/koha3/intranet/htdocs/intranet-tmpl/prog/en/includes/search_indexes.inc

замість рядка

<option value="callnum">     Call number</option>

додати рядки

<option value="callnum">     Call number</option>
<option value="UDC-classification,first-in-subfield">     UDC-classification</option>
<option value="Dewey-classification,first-in-subfield">     Dewey-classification</option>
<option value="bbk,first-in-subfield">     BBK</option>
<option value="LC-call-number,first-in-subfield">     LC-call-number</option>

Відповідно також потрібно перегенерувати мовні шаблони, напр. для укр. та рос.:

cd /usr/share/koha3/misc/translator/;sudo env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib "./translate" install uk-UA
cd /usr/share/koha3/misc/translator/;sudo env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib "./translate" install ru-RU

Відновлення налаштування за класифікацією

Типово це не працює для використовуваного класифікаційного індексу (УДК, ББК, ДДК) і при оновленні вертається типовий варіант.

Декілька кроків:

1) build_browser_and_cloud.pl з інтегрованими таблицями УДК, ББК, ДДК для української.

Файл build_browser_and_cloud.pl можна знайти у теці PUBLIC хмарного сховища [htp://db.tt/ExL7MRZ Dropbox] Сергія Дубика.

Розміщуємо файл за шляхом /usr/share/koha3/bin/cronjobs

2) До таблиці „browser“ додати колонки „class_source“ та “language“

sql-команди для додавання

ALTER TABLE browser ADD class_source varchar(10);
ALTER TABLE browser ADD language varchar(25);
ALTER TABLE browser ADD parent_class varchar(255);
ALTER TABLE browser ADD query mediumtext;

Додатково: тип колонки „description“ змінити на „mediumtext“, тип колонки „classification“ змінити на „varchar(255)“.

3) Для періодичного оновлення ієрархії класифікаційних індексів (УДК, скорочені табл.) необхідно періодично (crontab) запускати сценарій

env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=usr/share/koha3/lib perl -I /usr/share/koha3/lib build_browser_and_cloud.pl \
   -b -f 675a -t 606 -c -m 3 -s udc -l uk_UA

для ДДК (скорочені табл. Дьюї) параметри:

  -b -f 676a -t 606 -c -m 3 -k ddc -l uk_UA

для ББК (скорочені таблиці ББК для наукових бібліотек) параметри:

  -b -f 686a -t 606 -c -m 3 -k rubbk -l uk_UA

4) Також змінюємо файл /usr/share/koha3/opac/htdocs/opac-tmpl/prog/en/modules/opac-browser.tt

Замінюємо рядок з пошуковим запитом

opac-search.pl?q=Dewey-classification

для УДК на

opac-search.pl?q=UDC-classification,first-in-subfield

для ББК на

opac-search.pl?q=bbk,first-in-subfield

для ДДК (Дьюї) на

opac-search.pl?q=Dewey-classification,first-in-subfield

Шаблон opac-browser.tt для мов відмінних від en залишається старий — необхідно теж оновити, напр. для укр. та рос.:

cd /usr/share/koha3/misc/translator/;sudo env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib "./translate" install uk-UA
cd /usr/share/koha3/misc/translator/;sudo env KOHA_CONF=/etc/koha3/koha-conf.xml PERL5LIB=/usr/share/koha3/lib perl -I /usr/share/koha3/lib "./translate" install ru-RU

P.S. Ще не реалізований у файлі build_browser_and_cloud.pl переклад терму "classification $_" у рядку

$sth->execute(length($_),$_,$classification->{$_}?$classification->{$_}:"classification $_",$browser_result{$_}->{value},

Оновлення завершено

Заходимо у інтерфейс бібліотекаря. Бачимо зміну версії за адресою http://localhost:8888/cgi-bin/koha/about.pl

Див. також