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.
- Create file of user IDs from the Alma Sandbox or Alma Analytics:
user_test.txt
- 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 "https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/${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
- Clean the XML file in VI:
:%s/<?xml version="1.0" encoding="UTF-8" standalone="yes"?>//gc
- 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
- Zip the file:
user_test.zip
- Copy the file to the directory you have defined for the user loader in Alma.
- Run the user synchronization job.