Batch delete of archival descriptions from a fonds while NOT deleting fonds or series

Skip to first unread message

Carolyn Sullivan

Jan 18, 2024, 12:48:13 PMJan 18
to AtoM Users

I received a request from my staff to batch delete archival descriptions from a fonds while leaving the fonds and series in that fonds intact.  In the documentation, I see there`s a symfony commandline tool, delete-description, that deletes specific descriptions given their slug, OR deletes a description and all its children, but nothing that would leave a series intact but delete all the children:

Does a tool/method exist for this somewhere?

(Also, out of curiosity--these tools are specific to AtoM, aren't they?  They aren't prepackaged with symfony?  So there a php scripts somewhere that manipulate the MySQL to do this stuff?  Where are those located, in case I'd like to take a poke at them in a test instance on my local computer?).


Dan Gillean

Jan 18, 2024, 3:17:52 PMJan 18
Hi Carolyn, 

I can answer the second part of your post better than the first, but let's see where we get along the way. 

So first: AtoM tasks do use elements of the Symfony framework (and Symfony does come with some CLI tasks in place if I recall correctly), but yes, we have developed most of them ourselves using the Symfony framework as scaffolding. Per the introduction provided in this slide deck (image below is from slide 10 of 28), each task has a type namespace first: 

You can find AtoM's CLI tasks in the code repository, or in your local codebase, in lib/task - from there, there are subdirectories that correspond to the type namespace of the task. See: 
Here is the tools:delete-drafts task, as an example: 
Now as to your question: 

There's not an easy way to delete all other descendants, but leave a fonds and its series intact. My best high-level suggestions would be: 
  • Using an export, then an import
    • Export the fonds as CSV, delete everything except the levels you want to keep, delete the original fonds, import the cleaned up CSV as new
  • Using SQL
    • You'd probably need to find the object IDs of all the records, and then target those you want deleted
    • Or perhaps you could look up the ID of the level of description terms  and then do a join to add a WHERE clause to the query...?  (needs further thought)
    • This sounds painful to me, tbh
  • Changing pub status, and then using the delete-drafts task
    • Make sure that EVERYTHING else in your AtoM installation is Published (unless you want it deleted!)
    • Set the whole fonds to Draft
    • Manually set the top level and the series back to published (without inheritance, so the descendants stay in Draft mode
    • Use the delete-drafts task, 
  • Modify one of the existing CLI tasks to better suit your needs
    • For example, figuring out how to copy the repository parameter from the delete-descriptions task to delete drafts
    • Then you could do as above, but not have to worry about other Draft records in your installation
    • Instead, you could create a new temporary repository record, and move the fonds there, then update pub status as above, use the modified task limited by repository, etc
In ALL of these above examples, I strongly recommend you make a data backup first! These are just ideas off the top of my head, and may have unintended side effects. In any case, I hope they inspire some ideas!


Dan Gillean, MAS, MLIS

You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages