Cleaning contentstore

cancel
Showing results for 
Search instead for 
Did you mean: 
skushnerenko
Active Member II

Cleaning contentstore

Jump to solution

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)

1 Solution

Accepted Solutions
skushnerenko
Active Member II

Re: Cleaning contentstore

Jump to solution

I have found a solution, seems like the repository is purged by special job contentStoreCleaner:

Cleaning up orphaned content (purge) | Alfresco Documentation 

And it should take by default about 14 days to purge unused content.

View solution in original post

2 Replies
skushnerenko
Active Member II

Re: Cleaning contentstore

Jump to solution

I have found a solution, seems like the repository is purged by special job contentStoreCleaner:

Cleaning up orphaned content (purge) | Alfresco Documentation 

And it should take by default about 14 days to purge unused content.

cesarista
Customer

Re: Cleaning contentstore

Jump to solution

Maybe this helps:

 

https://i1.wp.com/blyx.com/wp-content/uploads/2014/08/Slide1.png 

In Alfresco 5 you can set this parameter for reducing this protection:

system.content.orphanProtectDays=14

Also if you apply sys:temporary aspect before deleting you will bypass the thrascan.

Regards.

--C.

Final hint: use better search.query() instead search.luceneSearch()