About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
indexing:koha

This is an old revision of the document!


How to index Koha with VuFind

This is how one university in Africa set up VuFind to index Koha.

Koha uses an ILS driver to connect the records with their holdings and status information. You still need to manually import the MARC data from Koha, so VuFind has the records. But once those records are there, VuFind can determine the status of the items.

Exporting Records From Koha

Koha has a misc/export_records.pl file which allows you to export to MARC format.

To run that manually, you will need to either set the path for PERL5LIB (or whatever your perl lib variable is) and the variable that points to the Koha configuration file manually, or run `koha-shell <instance>`. Setting the variables manually would look something like (<instance> is the Koha instance name):

export PERL5LIB=/usr/share/koha/lib:$PERL5LIB
export KOHA_CONF=/etc/koha/sites/<instance>/koha-conf.xml

To do the export, you will want to do something like this (the paths may differ)

/usr/share/koha/bin/export_records.pl --format marc --record-type bibs --filename kohabibs.mrc

Importing Into VuFind

Once you have exported the koha records, you will need to import the records into VuFind.

Copy your marc_local.properties from $VUFIND_HOME/import to the $VUFIND_LOCAL_DIR/import (local settings) directory.

Make the changes to this file that you need to

#collection = "collection"
institution = "My University"
#building = "Library A"
id = 999c, first

Koha needs to use the id = 999c for Vufind to properly tie the two together. The id= field is not in every version of the marc_local.properties file, so you may need to add that manually. This is the field that the book IDs are stored in. Koha and VuFind use different fields by default. (vufind = 001, koha = 999c)

Now you are ready to run the import:

./import-marc.sh [directory]/kohabibs.marc

Suppressed Records

Note: If you want to exclude suppressed records from display in VuFind, you may need to add additional settings to your import configuration. Koha stores suppressed status in MARC field 942, subfield n. A value of “1” or “Y” in 942n indicates a suppressed record. Adding a line similar to this to your marc_local.properties may help:

suppressed_str = 942n ? ($n matches "[^1Y]*.*"), DeleteRecordIfFieldEmpty

The Koha ILS Driver

:!: The example here describes the simple, database-driven Koha driver; newer VuFind releases may include KohaILSDI and/or KohaRest drivers that implement additional functionality using APIs found in newer Koha versions.

You will need to change the $VUFIND_LOCAL_DIR/config/vufind/config.ini file to have

[Catalog]
driver = "Koha"

This will enable the Koha ILS driver. But you will still need to configure it. Copy the Koha.ini file from $VUFIND_HOME/config/vufind/Koha.ini to $VUFIND_LOCAL_DIR/config/vufind/Koha.ini (from the global directory to the VuFind local settings directory).

Change your Koha.ini file to reflect your site.

[Catalog]
host        = localhost
port        = 3306
username    = mysqluser
password    = mysqlpass
database    = koha_database
url         = http://library.myuniversity.edu/
[Location_Codes]
AV          = "Audio Visual"
CART        = "Book Cart"
CHILD       = "Children's Area"
DISPLAY     = "On Display"
FIC         = "Fiction"
GEN         = "General Stacks"

The Koha username may not be the MySQL root user. It is safest to have an alternate user for such things. This MySQL user needs to have access to the Koha database. The MySQL password should be the MySQL password that corresponds to the MySQL username. If you want to test this, from the command line you can run:

mysql -u [mysqluser] -p [kohadatabase]

It will prompt you for the password. If it works, then you are fine. If it fails, then you will need to verify the username / password / database with your system administrator.

Once you have your koha.ini file set up, restart Solr and check to see that your Koha records show up, and that the holdings information shows up.

Troubleshooting

For Koha exporting troubleshooting, check out the Koha forums.

For MARC import/export, look at the page on marc import/export

There is a page for ILS troubleshooting

indexing/koha.1616594441.txt.gz · Last modified: 2021/03/24 14:00 by emaijala