Warning: This page has not been updated in over over a year and may be outdated or deprecated.
administration:automation:koha
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
administration:automation:koha [2023/03/06 20:41] – demiankatz | administration:automation:koha [2023/05/03 16:40] (current) – [VuFind® / Koha Automation] demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== VuFind® / Koha Automation====== | ====== VuFind® / Koha Automation====== | ||
- | // Thanks to Mohan Pradhan for developing this documentation. // | + | // Thanks to Mariyapillai Jayakananthan and Mohan Pradhan for developing this documentation. // |
=====Auto-incremental harvesting and indexing ===== | =====Auto-incremental harvesting and indexing ===== | ||
Line 8: | Line 8: | ||
Some notes: | Some notes: | ||
- | * In examples, | + | * In examples, |
* The example script assumes that VuFind®' | * The example script assumes that VuFind®' | ||
==== Script for incremental OAI-PMH harvesting and indexing with VuFind® ==== | ==== Script for incremental OAI-PMH harvesting and indexing with VuFind® ==== | ||
- | Create a script with the filename **harvest.sh**. You can put this script anywhere you like; $VUFIND_LOCAL_DIR/ | + | Create a script with the filename **harvest.sh**. You can put this script anywhere you like; $VUFIND_LOCAL_DIR/ |
<code bash> | <code bash> | ||
Line 20: | Line 20: | ||
export PATH=/ | export PATH=/ | ||
source / | source / | ||
+ | |||
+ | # Koha source defined in oai.ini; change as needed | ||
+ | OAI_KOHA_SOURCE=Koha | ||
# Harvest new records: | # Harvest new records: | ||
- | php $VUFIND_HOME/ | + | php $VUFIND_HOME/ |
# Process harvested Koha records: | # Process harvested Koha records: | ||
- | $VUFIND_HOME/ | + | $VUFIND_HOME/ |
- | $VUFIND_HOME/ | + | $VUFIND_HOME/ |
# Rebuild index | # Rebuild index | ||
Line 32: | Line 35: | ||
</ | </ | ||
- | Make sure the file is owned by an appropriate user (generally, it is best to have a specific account reserved for VuFind®-related processes). If necessary, change file ownership, e.g.: '' | + | Make sure the file is owned by an appropriate user (generally, it is best to have a specific account reserved for VuFind®-related processes |
Make the file executable by running this command: '' | Make the file executable by running this command: '' | ||
Line 51: | Line 54: | ||
(This example runs the script every day at 8:15pm; see [[administration: | (This example runs the script every day at 8:15pm; see [[administration: | ||
+ | |||
+ | ==== Incorporating additional sources ==== | ||
+ | |||
+ | It is possible that your VuFind® instance harvests records from multiple sources. In that case, you can feel free to add additional harvesting and indexing steps to the script. | ||
+ | |||
+ | === Koha + DSpace example === | ||
+ | |||
+ | For example, if you ingest DSpace records along with Koha records, you could modify the script to something like this: | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | # Set up necessary environment variables | ||
+ | export PATH=/ | ||
+ | source / | ||
+ | |||
+ | # The names of the harvest sections in oai.ini; change as needed: | ||
+ | OAI_DSPACE_SOURCE=DSpace | ||
+ | OAI_KOHA_SOURCE=Koha | ||
+ | |||
+ | # Harvest new records (do not specify a harvest source in order to harvest all sources): | ||
+ | php $VUFIND_HOME/ | ||
+ | |||
+ | # Process harvested DSpace records: | ||
+ | $VUFIND_HOME/ | ||
+ | $VUFIND_HOME/ | ||
+ | |||
+ | # Process harvested Koha records: | ||
+ | $VUFIND_HOME/ | ||
+ | $VUFIND_HOME/ | ||
+ | |||
+ | # Rebuild index | ||
+ | $VUFIND_HOME/ | ||
+ | </ | ||
+ | |||
+ | === Multiple Koha instances example === | ||
+ | |||
+ | As another example, if you harvest from multiple Koha instances using [[indexing: | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | # Set up necessary environment variables | ||
+ | export PATH=/ | ||
+ | source / | ||
+ | |||
+ | # Harvest new records (do not specify a harvest source in order to harvest all sources): | ||
+ | php $VUFIND_HOME/ | ||
+ | |||
+ | # Process harvested Koha records from two sources -- this example uses the names " | ||
+ | # and " | ||
+ | # You could repeat the import/ | ||
+ | # an appropriate configuration file and directory name. Note that if you applying a different | ||
+ | # ID prefix to each source, additional work may be needed to pre-process deleted record IDs so | ||
+ | # that batch-delete.sh works as expected. | ||
+ | $VUFIND_HOME/ | ||
+ | $VUFIND_HOME/ | ||
+ | $VUFIND_HOME/ | ||
+ | $VUFIND_HOME/ | ||
+ | |||
+ | # Rebuild index | ||
+ | $VUFIND_HOME/ | ||
+ | </ | ||
---- struct data ---- | ---- struct data ---- |
administration/automation/koha.1678135311.txt.gz · Last modified: 2023/03/06 20:41 by demiankatz