Table of Contents
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 cgi-bin/tools/export.pl file which allows you to export to MARC format.
To run that manually, you will need to set the path for PERL5LIB (or whatever your perl lib variable is), and set the variable that points to the Koha configuration file. They will look something like:
export PERL5LIB=/usr/share/koha/lib:$PERL5LIB export KOHA_CONF=/etc/koha/sites/library/koha-conf.xml
To do the export, you will want to do something like this (the paths may differ)
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:
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.