AnsweredAssumed Answered

Cleaning contentstore

Question asked by skushnerenko on Sep 4, 2018
Latest reply on Sep 5, 2018 by cesarista

I have cleaned contentstore, which was about 2 GB, from user files via script

var docs = search.luceneSearch("PATH:\"/app:company_home/cm:main//*\" AND TYPE:\"doc:somecontent\"");

var i;
for (i=0; i<docs.length; i++)
{
docs[i].remove();
}

//folders

var docs = search.luceneSearch("PATH:\"/app:company_home/cm:main//*\" AND TYPE:\"cm:folder\" AND NOT TYPE:\"cm:systemfolder\" AND NOT @cm\\:name:\"folder1\" AND NOT @cm\\:name:\"folder2\" AND NOT @cm\\:name:\"folder3\" AND NOT @cm\\:name:\"folder4\" AND NOT @cm\\:name:\"folder5\" AND NOT @cm\\:name:\"folder6\" ");
var i;
for (i=0; i<docs.length; i++)
{
docs[i].remove();
}

 

When the contentstore was empty, I emptied trashcan too.

So the trashcan is absolutely empty.

The Alfresco instance is nearly clean, but the contentstore on file system is still of 2GB size.

How is it possible to remove unused content from repository on file system?

Alfresco Community (Build: 201612)

Outcomes