Purging of Content in Alfresco

In my previous post we get idea about content lifecycle within Alfresco. Now when alfresco instance used for long time means for many years there are various contents uploaded and deleted and as we have seen in the content lifecycle post that orphan contents are always there in the alfresco filesystem so ultimately it will increase the size of that file system become mammoth and will be difficult to handle.

Best way to handle deleted contents is by configuring contentstoreCleaner. It can be done by following steps.

Orphaned content can be deleted or purged from the content store while the system is running. Identifying and either sequestering or deleting the orphaned content is the job of the contentStoreCleaner.

contentStoreCleanerTrigger fires the contentStoreCleaner bean.

  <bean id="contentStoreCleaner" class="org.alfresco.repo.content.cleanup.ContentStoreCleaner" >

     <property name="protectDays" >

        <value>20</value>

     </property>

     <property name="stores" >

        <list>

           <ref bean="fileContentStore" />

        </list>

     </property>

     <property name="listeners" >

        <list>

           <ref bean="deletedContentBackupListener" />

        </list>

     </property>

  </bean>
  • protectDays

This property to state the minimum time that content binaries should be kept in the contentStore. In the above example, if a file is created and immediately deleted, it will not be cleaned from the contentStore for at least 20 days. It should never be 0.

protectDays> number of days between successive backup runs(In case of system backup strategy is just to make regular copies)

  • store

This is a list of ContentStore beans to scour for orphaned content.

  • listeners

When orphaned content is located, these listeners are notified. In this example, the deletedContentBackupListener copies the orphaned content to a separate deletedContentStore.

Note that this configuration will not actually remove the files from the file system but rather moves them to the designated deletedContentStore, usually contentstore.deleted. After moving an orphaned content file out of the active content-store, the relevant line in the alf_content_url table deleted from the DB. The files can be removed from the deletedContentStore via script or cron job once an appropriate backup has been performed.

Looking for quality Alfresco Web Hosting ? Look no further than Arvixe Web Hosting!

Tags: , , , , , , | Posted under Alfresco | RSS 2.0

Author Spotlight

mitpatoliya

mitpatoliya

I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 5 = 9

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>