Regenerating Ref IDs

29 views
Skip to first unread message

Duryee, Alexander

unread,
Jun 3, 2025, 9:46:05 AM6/3/25
to 'Julia Novakovic' via Archivesspace_Users_Group
We use the refid_rules plugin to auto-generate serial numbers for archival objects' Ref IDs, using the Sequence table to track the current record number for each finding aid.  We also have a number of Ref IDs that do not adhere to the refid_rules structure (e.g. those that were explicitly set in e.g. spreadsheet/EAD import).  Ideally, we would delete the bad Ref IDs and generate new ones, which would ensure adherence to the refid_rules structure and keep the finding aids' Sequence values synced to the archival objects.  However, there doesn't seem to be any way to delete/regenerate a Ref ID.  I tried setting a ref_id to null via the API and database on a test instance, but neither actually reset the value.

Is there any way to delete/regenerate a Ref ID at all?  I would really like to avoid having to manually set Ref IDs + the Sequence values via database updates, if possible.

Thanks,
--Alex





Alexander Duryee, he/him

Service Manager, Archives & Special Collections Systems

Technical Services for Archives and Special Collections

Harvard Library Archives, Art, and Special Collections
 
alexande...@harvard.edu
617-384-0477

Remote: Monday-Friday
 
HARVARD LIBRARY
Champions of Curiosity
library.harvard.edu

 

Brian Harrington

unread,
Jun 3, 2025, 10:35:07 AM6/3/25
to Duryee, Alexander, 'Julia Novakovic' via Archivesspace_Users_Group

Hi Alex,

 

I’ve done this.  You can change the following line in the refid_rules plugin from true to false.  https://github.com/archivesspace/archivesspace/blob/fc923d295d49a1720bac902555407cef665218e1/plugins/refid_rules/backend/model/archival_object.rb - L13

 

That will cause the refid to be updated every time an object is saved, so you probably want to do it when no one is working in the site.  Then you can just read and write back the objects you want to update using the API.  When you’re done, change it back to false, restart, and you should be good to go.

 

I hope this helps.

 

Brian

 

-- 

Brian Harrington (he/him)

Data Migration Specialist

Lyrasis

brian.ha...@lyrasis.org

 

 

From: <archivesspac...@lyrasislists.org> on behalf of "Duryee, Alexander" <alexande...@harvard.edu>
Date: Tuesday, June 3, 2025 at 9:46 AM
To: 'Julia Novakovic' via Archivesspace_Users_Group <archivesspac...@lyrasislists.org>
Subject: [ArchivesSpace Users Group] Regenerating Ref IDs

 

You don't often get email from alexande...@harvard.edu. Learn why this is important

--
You received this message because you are subscribed to the Google Groups "Archivesspace_Users_Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Archivesspace_User...@lyrasislists.org.
To view this discussion visit https://groups.google.com/a/lyrasislists.org/d/msgid/Archivesspace_Users_Group/DM6PR07MB425238EEB230AB19120D6A5BF36DA%40DM6PR07MB4252.namprd07.prod.outlook.com.

Brian Harrington

unread,
Jun 3, 2025, 11:03:50 AM6/3/25
to Duryee, Alexander, 'Julia Novakovic' via Archivesspace_Users_Group

Oops.  I mean change it back to true.  But you probably figured that out.

 

Brian

Reply all
Reply to author
Forward
0 new messages