* config.rb - the configuration file
* migrate.rb - the script
- Ruby (tested using v. 2.1.7)
- A valid AWS credentials file (see here for setup and https://developers.exlibrisgroup.com/alma/integrations/digital/almadigital on how to generate your institution's access key)
The tool runs the following procedure:
- Sends an OAI-PMH ListRecords request (based on a pre-configured base URL and set)
- Downloads OAI-PMH records (provided in MARCXML format)
- Downloads each stream referenced in the 856$$u subfield
- Renames the streams according to the HTTP header and replaces the 856$$u content
- Creates a new ingest folder in your institution's upload folder, under a pre-configured MD Profile ID
- Creates a MARCXML collection file and uploads the file and referenced streams to the ingest folder
- Cleans up the local temp folder
The tool is adapted to the DigiTool OAI-PMH and delivery responses, but with minor changes can be used for any repository that publishes according to OAI-PMH standards. The tool requires that record contain a direct URL to the stream. In DigiTool, this requires the request to be caught be a delivery rule that delivers a stream (as opposed to a viewer).
The script is available here. Be sure to check for required gems.