MARC (Machine-Readable Cataloguing) is the global standard format that libraries use to store bibliographic records — book titles, authors, subjects, ISBNs, and more. VuFind® was built around MARC from the ground up and uses SolrMarc to transform your MARC records into a searchable Apache Solr index.
A structured data file describing one item in your library — title, author, subject, ISBN, call number, etc. Each record has a unique ID.
The import tool bundled with VuFind®. It reads your MARC file and transforms each record into a document in the Solr search engine.
The search engine that powers VuFind®. After importing, Solr indexes all your records so users can search and filter them instantly.
Your library management system (e.g. Koha, Symphony, Alma). This is where your records live — you export from here and import into VuFind®.
Before diving into steps, here's the big picture of what happens when you import MARC records:
Before importing into VuFind®, you need to get the records out of your Integrated Library System (ILS/LMS). The exact steps differ by system — select yours below.
Open a terminal and set the required environment variables. Adjust paths to match your Koha installation:
export PERL5LIB=/usr/share/koha/lib:$PERL5LIB
export KOHA_CONF=/etc/koha/sites/library/koha-conf.xml
/etc/koha/sites/<sitename>/koha-conf.xml.Run Koha's export script to dump all records. Export to XML format is recommended as it handles special characters more reliably:
/usr/share/koha/bin/export_records.pl --format=xml --filename="koha.xml"
--format=marc for binary MARC (ISO 2709), which produces a .mrc file instead.Koha stores its unique bibliographic ID in MARC field 999$c, not in the standard 001 field. You must tell VuFind®'s importer where to find this ID, otherwise records won't link back to Koha correctly.
Copy the local properties template and edit it:
cp /usr/local/vufind/import/marc_local.properties \
/usr/local/vufind/local/import/marc_local.properties
cp copies a file. We copy the template from VuFind®'s core directory into the local/ directory — always make your edits in local/ so they survive upgrades and don't touch the VuFind® core files.Open the copied file and make sure these settings are present (add or edit as needed):
# Your institution name — appears in the "Institution" facet
institution = "My Library"
# Koha uses field 999$c for the unique bib record ID
id = 999c, first
# Optional: set a building/collection label
#building = "Main Library"
My Library with your actual institution name — this is what users see in the search filters.first keyword means take only the first occurrence if there are multiple. Without this, VuFind® uses field 001 and won't match records back to your Koha catalogue.1. Use the right format and extension:
# Binary MARC (ISO 2709) — must use .mrc extension
your_records.mrc
# MARC-XML — must use .xml extension
your_records.xml
2. Include a unique identifier in every record:
By default, VuFind® expects the unique record ID in MARC field 001. Make sure your ILS includes the bibliographic record ID in this field. If your ILS stores the ID elsewhere (like Koha's 999$c), you'll need to configure marc_local.properties accordingly.
3. Where to find ILS-specific export documentation:
https://vufind.org/wiki/indexing:marc:export_notes
The VuFind® community maintains export notes for many ILS systems including Alma, Evergreen, Horizon, Polaris, Sierra, Symphony, and more.
VuFind® ships with sample MARC records in its test data directory. These are perfect for verifying your setup works before importing your real catalogue:
ls /usr/local/vufind/tests/data/*.mrc
.mrc binary MARC files in VuFind®'s test data directory. You'll see files like test.mrc which contain a handful of sample bibliographic records ready to import.You can import one of these directly in Step 3 — for example:
/usr/local/vufind/tests/data/test.mrc
You can also download free MARC records from the Internet Archive for a larger test dataset:
# Internet Archive UNC MARC records (large dataset)
https://archive.org/details/unc_catalog_marc
SolrMarc uses two types of configuration files. It's important to understand their roles:
The main config. Controls high-level settings: Solr URL, which index specification files to load, and Java options. Usually doesn't need changing.
The index spec you customise. Defines how MARC fields map to Solr fields — institution name, ID field, building, collection, etc.
Here's where these files live in a standard VuFind® installation:
If you haven't already done so in Step 1, copy and edit the local properties file:
# Create the local import directory if it doesn't exist
mkdir -p /usr/local/vufind/local/import
# Copy the template
cp /usr/local/vufind/import/marc_local.properties \
/usr/local/vufind/local/import/marc_local.properties
# Open it in nano to edit
nano /usr/local/vufind/local/import/marc_local.properties
-p flag prevents errors if the folder already exists.Ctrl+O to save and Ctrl+X to exit.The key settings to review and customise:
# ── Required: your institution name ──
institution = "University of Example"
# ── Optional: collection or building facet ──
#collection = ""
#building = "Main Library"
# ── Koha only: use 999c as the unique record ID ──
# id = 999c, first
# ── Other ILS: leave id commented out to use default MARC 001 ──
# at the start of the line to enable it.Next, verify the Solr URL in import.properties is correct (usually no change needed):
# Default Solr URL — should be correct for a standard install
solr.hosturl = http://localhost:8983/solr/biblio/update
Navigate to your VuFind® directory and run the import script with your MARC file:
cd /usr/local/vufind
./import-marc.sh /path/to/your_records.mrc
/path/to/your_records.mrc with your actual file path.cd /usr/local/vufind
./import-marc.sh file1.mrc file2.mrc file3.mrc
.mrc file in a directory at once.cd /usr/local/vufind
./import-marc.sh -p /usr/local/vufind/local/import/import.properties \
your_records.mrc
-p switch overrides which SolrMarc configuration file to use. When omitted, the script automatically uses local/import/import.properties if it exists, otherwise falls back to import/import.properties. Use -p when you have multiple configurations for different record sets.# Start a detachable terminal session
screen -S marc-import
# Then run the import as normal — press Ctrl+A then D to detach
cd /usr/local/vufind
./import-marc.sh your_records.mrc
# Reattach later to check progress
screen -r marc-import
screen creates a persistent terminal session that keeps running even if your SSH connection drops. The -S flag names the session so you can find it again easily. If screen isn't installed, run sudo apt-get install screen first.After importing, open your VuFind® site in a browser. If the new records don't appear in search results within a minute or two, restart Solr:
cd /usr/local/vufind
./solr.sh stop
./solr.sh start
After a large import, it's good practice to optimize the Solr index. This merges index segments for faster queries and regenerates the spelling index (which powers VuFind®'s "Did you mean?" suggestions).
cd /usr/local/vufind
php public/index.php util/optimize
VuFind® has a separate authority index for name and subject authority records (e.g. Library of Congress authority files). Importing these enables better subject heading cross-references and search enhancements.
Use the dedicated authority import script — it works exactly like import-marc.sh but targets a different Solr core:
cd /usr/local/vufind
# Standard authority records (ID in 010 field — LC format)
./import-marc-auth.sh your_authority_file.mrc
# ILS-exported authority records (ID in 001 field)
./import-marc-auth.sh your_authority_file.mrc marc_auth_ils.properties
import/import_auth.properties for its configuration and import/marc_auth.properties for field mappings — a separate set from the bibliographic import.marc_auth_ils.properties when your authority records came from an ILS export that stores the unique ID in field 001 rather than the standard Library of Congress 010 field.If you're importing records from multiple branches or institutions, you can tag each set with a different Institution or Building label by creating separate configuration files for each.
Create a separate index specification file for each library. These only need to contain the settings that differ — everything else is inherited from marc_local.properties:
# Create spec for Library 1
echo 'institution = "Library 1"' > \
/usr/local/vufind/local/import/marc_library1.properties
# Create spec for Library 2
echo 'institution = "Library 2"' > \
/usr/local/vufind/local/import/marc_library2.properties
echo outputs text to the terminal; the > operator redirects that output into a file, creating the file if it doesn't exist. This is a quick way to create a small single-line config file without opening a text editor.Copy the main import.properties once for each library and edit the solr.indexer.properties line to chain in the library-specific spec:
cp /usr/local/vufind/import/import.properties \
/usr/local/vufind/local/import/import_library1.properties
nano /usr/local/vufind/local/import/import_library1.properties
Inside the file, find and update the solr.indexer.properties line:
# Chain the spec files — last file wins for duplicate settings
solr.indexer.properties = marc.properties, marc_local.properties, marc_library1.properties
marc_library1.properties is last, so its institution value overrides the one in marc_local.properties. Repeat this pattern for each library.Repeat for Library 2 (and any others), changing the filename and spec file reference accordingly.
Now run the import once per library, passing the correct configuration each time:
cd /usr/local/vufind
# Import Library 1 records
./import-marc.sh -p /usr/local/vufind/local/import/import_library1.properties \
/path/to/library1.mrc
# Import Library 2 records
./import-marc.sh -p /usr/local/vufind/local/import/import_library2.properties \
/path/to/library2.mrc
library1.mrc will be tagged with Institution = "Library 1". Users can then filter search results by institution using VuFind®'s facets.VuFind® can harvest and index the full text of documents if your MARC records contain URLs (e.g. in field 856). This is disabled by default and requires an additional tool to be installed first.
Step 1: Install a full-text extraction tool (Apache Tika recommended):
sudo apt-get install default-jre
wget https://downloads.apache.org/tika/tika-app-2.9.2.jar -O /usr/local/vufind/import/tika-app.jar
Step 2: Enable full text in marc_local.properties by uncommenting the fulltext line:
# Remove the # at the start of this line to enable full text indexing:
fulltext_str_mv = FullTextExtractor(856u, "org.solrmarc.index.extractor.impl.fulltext.FullTextExtractor")
For production use, set up a cron job to re-export and re-import records automatically. Open your crontab and add an entry:
crontab -e
minute hour day month weekday command. * means "every".Add one of these example schedules depending on how often your catalogue changes:
# Run a full reimport every night at 2:00 AM
0 2 * * * cd /usr/local/vufind && ./import-marc.sh /data/exports/catalogue.mrc >> /var/log/vufind-import.log 2>&1
# Optimize the index every Sunday at 3:00 AM (after nightly import)
0 3 * * 0 cd /usr/local/vufind && php public/index.php util/optimize >> /var/log/vufind-optimize.log 2>&1
*), every month (*), every day of the week (*). Translates to: every night at 2:00 AM.cat /var/log/vufind-import.log.0 = Sunday). Schedule optimization after the import completes — hence 1 hour later on a weekly basis to avoid slowing daily imports.