delete all publications uploaded to dspace

217 views
Skip to first unread message

Gina Alegre Milla

unread,
May 15, 2023, 7:25:51 PM5/15/23
to DSpace Community
I have dspace 7.0 installed and have been creating communities, collections and publications to test the platform. Now, I want to delete all the publications that I have uploaded to dspace, but I want to do it in bulk. From the web I have validated but it only allows to delete one by one.

Is it possible to delete all the publications massively either from the web, by cli or from the same database?

Note: The communities and collections should be kept, I just need to delete all the publications.

Regards 

DSpace Community

unread,
May 17, 2023, 3:23:33 PM5/17/23
to DSpace Community
Hi,

There's no way to easily delete all Items from DSpace from the Admin UI itself while keeping Communities and Collections.  However, there's a few tools you might be able to use which could help with this.

1. Batch Metadata Editing tool.  If you export Item metadata to CSV (this can be done after performing a search, or from the "Export -> Metadata" menu), then it's possible to use that CSV to "expunge" all the items listed in that CSV.   See the documentation at https://wiki.lyrasis.org/display/DSDOC7x/Batch+Metadata+Editing#BatchMetadataEditing-Performing'actions'onitems   This would require editing the CSV to add an "action" column and then re-importing it ("Import -> Metadata" menu).

2. If you have basic programming skills or have someone on staff who does, it's possible to use the REST API to DELETE items one by one.  https://github.com/DSpace/RestContract/blob/main/items.md#deleting-an-item   So, it would be possible to write a small script which logs in as an Admin and calls the main /items endpoint to list all Items (https://github.com/DSpace/RestContract/blob/main/items.md#main-endpoint), then loop through each item and call "DELETE /api/core/items/[:uuid]" on each one.

Tim

Reply all
Reply to author
Forward
0 new messages