The following procedure explains how to export Evergreen bibliographic records into MARC files using the marc_export support script. All steps should be performed by the
opensrf
user from your Evergreen server.
The major advantages of the command line approach are its speed and its convenience for system administrators who can perform bulk loads of authority records in a controlled environment.
Run marc2are.pl against the authority records, specifying the user name, password, MARC type (USMARC or XML). Use
STDOUT
redirection
to either pipe the output directly into the next command or into an output file for inspection. For example, to process a file with authority records in MARCXML format
named auth_small.xml
using the default user name and password, and directing the output into a file named auth.are
:
cd Open-ILS/src/extras/import/
perl marc2are.pl --user admin --pass open-ils --marctype XML auth_small.xml > auth.are
The MARC type will default to USMARC if the --marctype
option is not specified.
Run pg_loader.pl to generate the SQL necessary for importing the authority records into your system. To save time for very large batches of records, you could simply pipe the output of marc2are.pl directly into pg_loader.pl.
cd Open-ILS/src/extras/import/
perl pg_loader.pl --auto are --order are auth.are > auth_load.sql
Load the authority records from the SQL file that you generated in the last step into your Evergreen database using the psql tool. Assuming the default user name, host name, and database name for an Evergreen instance, that command looks like:
psql -U evergreen -h localhost -d evergreen -f auth_load.sql
Good for loading batches of up to 5,000 records (roughly) at a time, the major advantages to importing authority records using the MARC Batch Import/Export interface are that it does not require command-line or direct database access – good for both security in that it minimizes the number of people who need this access and for spreading the effort around to others in the library – and it does most of the work (for example, figuring out whether the batch of records is in XML or USMARC format) for you.
To import a set of MARC authority records from the MARC Batch Import/Export interface:
From the Evergreen staff client, select Evergreen MARC File Upload screen opens, with Import Records as the highlighted tab.
→ . TheFrom the
drop-down menu, select .Enter a name for the queue (batch import job) in the Create a new upload queue field.
Select the Auto-Import Non-Colliding Records checkbox.
Click the
button to select the file of MARC authorities to import.Click the Uploading… Processing… to show that the records are being transferred to the server, then displays a progress bar to show the actual import progress. When the staff client displays the progress bar, you can disconnect your staff client safely. Very large batches of records might time out at this stage.
button to begin importing the records. The screen displaysOnce the import is finished, the staff client displays the results of the import process. You can manually display the import progress by selecting the Inspect Queue tab of the MARC Batch Import/Export interface and selecting the queue name. By default, the staff client does not display records that were imported successfully; it only shows records that conflicted with existing entries in the database. The screen shows the overall status of the import process in the top right-hand corner, with the Total and Imported number of records for the queue.