Deleting physical locations

93 views
Skip to first unread message

buck...@gmail.com

unread,
Sep 5, 2018, 10:01:09 AM9/5/18
to AtoM Users

Hi all,


I didn't see this in the documentation or see a topic for this, but if I missed it, please let me know.


Is there a way, CLI or otherwise, to mass delete physical locations? I had created physical locations not realizing they weren’t hierarchical and so am now stuck with a bunch of unrelated objects in “File 1”, for example, even though they’re in different boxes. I want to delete them and use a flat system for storage (ie “A1500, File 4” is one entry rather than “A1500” and “File 4” being two separate entries). However, there are way too many entries to delete manually, one by one. Is there a way to mass delete these both from descriptions and from the physical storage section itself?


Thanks,

Jarad

Dan Gillean

unread,
Sep 5, 2018, 6:30:30 PM9/5/18
to ICA-AtoM Users
Hi Jarad,

There's currently no way to do this via the user interface, but I've asked a developer to take a look to see if there is any reasonably simple SQL query we might be able to provide you with that will allow bulk deletion of locations. Hopefully one of us will have an update for you soon.

I haven't forgotten about testing the file you sent me further either - I've just been away for some time! Still hoping to find some time to get back to this at some point soon.

Regards,


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


--
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 ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/16dc0df5-dc65-43bb-a96f-492d1cfb65f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sbr...@artefactual.com

unread,
Sep 5, 2018, 7:26:46 PM9/5/18
to AtoM Users
Hi Jarad

Just to confirm, do you want to delete every physical location listed in your Physical Storage module (under Manage->Physical Storage) from your AtoM instance?  Regardless of whether the locations are currently linked to any descriptions or not?

If this is the case, after these are deleted you would need to manually create and link any physical locations you wanted using AtoM's Web interface.

Steve

buck...@gmail.com

unread,
Sep 6, 2018, 12:44:31 PM9/6/18
to AtoM Users
Thanks for the response. Yes, I want to delete everything in the physical storage module. Most entries were not created in a standardized fashion and, even those that were, were done so with a misunderstanding on my part of how physical storage/locations worked in AtoM. Figured it would be easier just to ditch them all and start fresh. After deletion, can new locations not be added to existing descriptions via a CSV update?

Cheers,
Jarad

buck...@gmail.com

unread,
Sep 6, 2018, 12:47:02 PM9/6/18
to AtoM Users
Hi Dan,

Thanks for looking into this. Regarding the file I sent, it may be moot if I end up deleting the locations and starting fresh, but if it can be determined what exactly went wrong, that'd be good too.

Thanks as always,
Jarad

sbr...@artefactual.com

unread,
Sep 6, 2018, 5:38:19 PM9/6/18
to AtoM Users

Hello Jarad


Yes - you are correct - you could use the csv import --update="match-and-update" to re-add these locations once the physical locations have been deleted. Make sure you make backups first, and use the “Skip unmatched” option, to avoid any potential errors!


I have created a script that will delete every physical storage location from an AtoM instance when run from the AtoM root folder using the "php symfony tools:run" CLI task.



Steps required to run it:

  1. Save this script on AtoM server.

  2. Run from AtoM root folder:  php symfony tools:run <full_path_to_this_file>

  3. The script will print the physical location name, location and type for each deleted location as it runs.



Steve


Steven Breker, BSc
AtoM Programmer
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

buck...@gmail.com

unread,
Sep 7, 2018, 12:55:45 PM9/7/18
to AtoM Users
Wow, that's amazing! Thanks, Steve. I don't currently have CLI or OS access myself, but I'll definitely send this to those that do and determine the best course moving forward.

Appreciate it.

Cheers,
Jarad

Jeremy Heil

unread,
Apr 20, 2022, 1:53:04 PM4/20/22
to AtoM Users
Greetings all!

I found this thread while I was looking for nearly the same solution, so figured it best to post here. Over the years, we've amassed around 1,000 orphan physical locations, left over from various updates and corrections to descriptions. I can locate all of these using  SELECT * FROM physical_object_i18n WHERE id NOT IN (SELECT subject_id FROM relation); - but I also know there are related records for each in the physical_object table. I was wondering whether anyone had any thoughts on how to cleanly delete these orphan locations from both tables without touching my 64,000 good locations (i.e. being more selective than Steven's script above)? 

Thanks in advance!

Jeremy

Dan Gillean

unread,
Apr 20, 2022, 2:12:27 PM4/20/22
to ICA-AtoM Users
Hi Jeremy, 

If I understand correctly, you only want to delete those containers that have no links to descriptions - is that correct?

If so, then you're in luck! Since this thread was last updated, we added a couple new physical storage management command-line tasks that should be of use to you. See them both here: 
If I'm understanding your ask correctly, then I think the second task, Delete Unlinked Physical Object Locations, should help provide what you need. Reviewing it, I'm realizing there's a bit of a copy-paste error between the two tasks, with some of the options in the deletion task being improperly described (using the descriptions from the task above), so I'll try to update that soon - but the screenshot of the task options should clarify. 

Most importantly, both tasks have a --verbose option and a --dry-run option, meaning you can run them to see the output without actually performing any changes. This might allow you to compare the task's output to what you're seeing via your SQL query. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


Jeremy Heil

unread,
Apr 20, 2022, 4:15:26 PM4/20/22
to AtoM Users
Brilliant! That's exactly what I was looking for (and it worked like a charm!). And great to know of the normailzation tool, which was something else I've been needing to do. Thanks so much, Dan!
Reply all
Reply to author
Forward
0 new messages