Exporting Bibliographic Records into MARC files

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.

Note

Processing time for exporting records depends on several factors such as the number of records you are exporting. It is recommended that you divide the export ID files (records.txt) into a manageable number of records if you are exporting a large number of records.

  1. Create a text file list of the Bibliographic record IDs you would like to export from Evergreen. One way to do this is using SQL:

    SELECT DISTINCT bre.id FROM biblio.record_entry AS bre
    	JOIN asset.call_number AS acn ON acn.record = bre.id 
    	WHERE bre.deleted='false' and owning_lib=101 \g /home/opensrf/records.txt;
    

    This query creates a file called records.txt containing a column of distinct IDs of items owned by the organizational unit with the id 101.

  2. Navigate to the support-scripts folder

    cd /home/opensrf/Evergreen-ILS*/Open-ILS/src/support-scripts/
    
  3. Run marc_export, using the ID file you created in step 1 to define which files to export.

    cat /home/opensrf/records.txt | ./marc_export -i -c /openils/conf/opensrf_core.xml \
    -x /openils/conf/fm_IDL.xml -f XML --timeout 5 > exported_files.xml
    
    

    The example above exports the records into MARCXML format.

    Note

    For help or for more options when running marc_export, run marc_export with the -h option:

    ./marc_export -h