Importing Authority Records from Command Line

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. For alternate instructions, see Importing Authority Records from the Staff Client.

  1. 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

    Note

    The MARC type will default to USMARC if the --marctype option is not specified.

  2. 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
  3. 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