Skip to main content
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    How to Load Patrons from Alma Sandbox to Alma Production in the Event of a Data Loss

    Created By: Lisa Hamlett
    Created on: 4/13/2021

    In April of 2021, I accidentally purged a bunch of users from Alma Production who needed to be reimported.  These are the steps my colleague, Alex Cooper, used to replace them from the Alma Sandbox.


    1. Create file of user IDs from the Alma Sandbox or Alma Analytics:


    2. Put the user IDs into the API call to create an XML file of user records from the Alma Sandbox:

      cat user_test.txt | while read line; do curl -X GET "${line}?user_id_type=all_unique&view=full&expand=none&apikey=[API KEY]" -H "accept: application/xml"; done >> user_test.xml 2> /tmp/user_test.log

    3. Clean the XML file in VI:

       :%s/<?xml version="1.0" encoding="UTF-8" standalone="yes"?>//gc 

    4. Prepare the XML file:

      add <?xml version="1.0" encoding="UTF-8" standalone="yes"?><users> to the beginning of the string and </users> to the end

    5. Zip the file:

    6. Copy the file to the directory you have defined for the user loader in Alma.
    7. Run the user synchronization job.