[Archivesspace_Users_Group] Bulk update File URIs for individual digital objects

Corey Schmidt Corey.Schmidt at uga.edu
Mon Mar 28 13:49:26 EDT 2022

Hey Kris,

For this problem, you could either update the file URIs in bulk by directly editing the data in the database or use the API. If you have access to either, I would go with whichever you are more comfortable. Editing in the database would be the fastest, but I would test any updates in a copy database first (either a local copy or a dev/staging instance you have). If you want to give the API a try (also testing in a copy instance), I would approach it by first creating a CSV or Excel file that lists the 100+ digital objects you want to update (the Digital Object ArchivesSpace URI) and the new digital object file URI you want to replace the old one, like this:

/repositories/4/digital_objects/1       https://www.mynewfileuri.com<https://www.mynewfileuri.com/>
/repositories/4/digital_objects/2       https://www.mynewfileuri.com<https://www.mynewfileuri.com/>
/repositories/4/digital_objects/3       https://www.mynewfileuri.com<https://www.mynewfileuri.com/>
/repositories/4/digital_objects/4       https://www.mynewfileuri.com<https://www.mynewfileuri.com/>

Then, using python, I would go through each row and do a GET request<https://archivesspace.github.io/archivesspace/api/#get-a-digital-object> for every digital object using the first column, update the returned JSON with the new file URI in the second column, then do a POST<https://archivesspace.github.io/archivesspace/api/#update-a-digital-object> to ArchivesSpace with the updated JSON for the digital object. If you need more help or want to walk through writing such a script, feel free to email me as I'd be more than happy to help. There's also this great resource<https://support.atlas-sys.com/hc/en-us/articles/360052217114-The-ArchivesSpace-API-Playbook#h_01EG0SJEJV5N9VE2ZM160T0VAQ> written by Valerie Addonizio for working with the API where she lists when to use the database vs. when to use the API.

Hope this helps,


Corey Schmidt
Special Collections Libraries | ArchivesSpace Project Manager

Corey.Schmidt at uga.edu<mailto:Corey.Schmidt at uga.edu>

From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Kris Santos <ksantos at dalton.org>
Sent: Monday, March 28, 2022 10:39 AM
To: archivesspace_users_group at lyralists.lyrasis.org <archivesspace_users_group at lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] Bulk update File URIs for individual digital objects


Hello all,

Is there a way to bulk update File URIs for digital objects? Our goal is just to update over 100 digital object's URI without having to do this item by item. While we have a solution for instances, we just want to know if there's a way to change the current URIs to the new ones in bulk.

If anyone in the community may have resources or insights to accomplish this process - whether it is 100 digital objects or 1000 digital objects - I appreciate your assistance and insights. Thank you for any help you can provide.

Kris Santos
(212) 423-5247
ksantos at dalton.org<mailto:ksantos at dalton.org> | archives at dalton.org<mailto:archives at dalton.org>
Dalton School Archives <https://www.dalton.org/programs/library/dalton-school-archives>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20220328/511f9303/attachment.html>

More information about the Archivesspace_Users_Group mailing list