cancel
Showing results for 
Search instead for 
Did you mean: 

How to bulk delete

dk_user
Champ in-the-making
Champ in-the-making
Hi,

I am very new Alfresco user. We have uploaded 18000 documents to Alfresco. Then we noticed that some categories are not correct. We would like to upload them again, but we don't know how to delete existing documents. Is there any way to delete all documents that were uploaded yesterday?

Thanks,
LodnonDev
3 REPLIES 3

marcus_svensson
Champ in-the-making
Champ in-the-making
The easiest way would be to just remove the parent folder (if there is just one or a few) using the Alfresco Explorer client and skip archiving.

I've noticed in some cases that Alfresco Share is not very good at deleting a large number of documents at one time (it times out after a while).

If you can't just remove a parent folder, then I'd say you have two options:
1. Restore a backup
2. Create a script in JavaScript or Java which executes a search for documents created for a certain date, and then delete them. Here it might be wise to split up the operation into several transactions which commit every now and then to not run into transaction cache problems. To speed things up, you might want to look into disabling Solr while and then enable it again after the delete operation is done.

zladuric
Champ on-the-rise
Champ on-the-rise
Also a good thing to do - if you're taking a custom javascript or java script - is to add the aspect "sys:temporary" on the file before deleting it. That will also skip the archive.

gluck113
Star Contributor
Star Contributor

For people who are asking themselves the same question, there is a github project : 

GitHub - fsforna/MassiveDelete: A simple Alfresco massive deletion batch 

from francesco fornasari and Christian Tiralosi.

You "just" need to extract the document ID you want to delete (CMIS/DB queries), and put it into a csv.