EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #10366


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Sharing a Custom Koha to EPrints Harvester (Live Sync & No Duplicates)


CAUTION: This e-mail originated outside the University of Southampton.


--
|     

Hi everyone,

I'm writing from the Faculty of Architecture, Design and Urbanism at the University of Buenos Aires (UBA FADU). We recently tackled a common issue when integrating Koha and EPrints, and I wanted to share our solution with the community in case it serves as a helpful blueprint for others.

We needed to automate the daily ingestion of electronic theses from Koha (via MARCXML) into EPrints. As many of you know, standard OAI-PMH harvesting or basic import plugins often struggle with duplicates—especially when a record is harvested, moved from the buffer to the public archive, and then updated later in the Koha catalog. The standard behavior usually triggers the creation of a duplicate in the buffer instead of updating the live record.

To solve this, we built a custom middleware (a Bash script for the cronjob + a Perl Import Plugin) that implements what we call "Live Sync".

Key features include:

  • Global Duplicate Checking: The Perl plugin searches the global eprint dataset (rather than being restricted to the destination dataset) using a unique Koha control field ID.

  • Safe In-Place Updates: If the record already exists in the live archive, the script updates the metadata in-place using $eprint->update(). Attached PDFs and documents are left completely untouched.

  • Incremental Harvesting: The Bash script handles daily incremental downloads using the OAI-PMH from parameter and pipes them securely into the EPrints command-line import tool.

  • Advanced MARC21 Mapping: It parses complex academic roles (e.g., Directors, Jurors) from 700/710 fields and automatically builds the institutional affiliation hierarchies required by our National Digital Repository System (SNRD).

I've uploaded the code to GitHub. While the specific MARC mappings are tailored to our institution's rules, the core Perl logic for the global duplicate check and safe metadata updating is universal and might save other sysadmins a lot of headaches.

You can find the code and documentation here: https://github.com/LopezAlejandro/koha-to-eprints-harvester

Feedback, forks, or suggestions are always welcome!

Best regards,

                           ( o o )
+------------------.oooO--(_)--Oooo.---------------------+
| Alejandro Lopez                                                  |
|              Linux User Nro : 65183                          |
| Buenos Aires                          Argentina             |
|                          (   )                                             |
+-------------------- -\ (----(   )-----------------------------+
                             \_)    ) /
                                   (_/