cancel
Showing results for 
Search instead for 
Did you mean: 

Delete ContentStore.deleted in Alf_data

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi all

I have a question about the deleted content that we produce in Alfresco. Normally when you delete an item (document…) this is not removed from your application and gets stored in the ContentStore.deleted folder in alf_data.

To finally remove it from the Alfresco system, we need to go to the admin screen "Manage Deleted Items" and in there Restore/Remove the content.

What we do is removing the content in that screen so we make sure it is not in the Alfresco system and it does not takes space in the hard disk.
At this moment we have no content/item to remove in the Alfresco UI, however we have a ContentStore.deleted folder of 7 GB. This is taking space for the Backup in the hard disk that we will not use.

How can we get rid of these 7 GB's in the ContentStore.deleted? I know we can not just remove the content of the folder from alf_data

Thanks a lot in advance for your help
18 REPLIES 18

heiko_robert
Star Collaborator
Star Collaborator
Hi,
everything is documented here:
http://wiki.alfresco.com/wiki/Content_Store_Configuration

regards

ivan_plestina
Champ in-the-making
Champ in-the-making
How can we get rid of these 7 GB's in the ContentStore.deleted? I know we can not just remove the content of the folder from alf_data

Actually you can and you should. When you create a file it has its .bin file in "contentstore" and there is a reference in database on that bin file. When you delete the document alfresco just updates stuff in database. When you purge the Deleted items alfresco destroys all references in database to that .bin file. Now what happens next is that there is a scheduled job that runs by default at 4am I think that scans the database and the "contentstore" and moves everything that is not referenced in DB to "contentstore.deleted". You should have your own OS cron job that purges contents of this folder periodically.

Now another question is what does property system.content.eagerOrphanCleanup found in repository.properties and accompanying bean in content-services-context.xml do? It's not documented in wiki and I haven't found time to test it yet…

So, if I understand, can I just run on my linux server:
'rm -R contentstore.deleted'
And nothing happens to my Alfresco?

shamabbas
Champ in-the-making
Champ in-the-making
Hi guys,

Did u findOut how to delete files from harddisk as well?
I developed an API to upload, download and delete files from Alfresco repository but when i delete file just get remove from database and can't download it buttttttt it doesn't get delete from my contentstore folder.

How to do it? please let me know if there any function or anything ??

I'll really appreciate your replies. thanx

Shamabbas

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi there

Sorry but dont understand exactly what your problem is. Let me explain

a) you are trying to develop a Java Api to integrate in Alfresco so you can delete the files from :"UI", "FTP Connection…"

b) You delete a file in Alfresco UI but it does not get moved from ContentStore folder in the OS system, to the ContentStore.deleted folder??

In case of b), you need to empty the recycle bin, once you delete a document in Alfresco it does not "desappear" from the system. It stays in a recycle bin until you purge it from there manually, so maybe this is what you still need to do. Once you purge the bin it will be moved to the alf_data/contentstore.deleted folder and then (thanks to ivan!!) Smiley Happy  you will need to schedule a task to empty the alf_data/contentstore.deleted.

Dont know if this has answered your question, but if not please share some more information about the process you are trying to build

Cheers

Luis

shamabbas
Champ in-the-making
Champ in-the-making
Yes i have developed an WS API in Java to integrate with Alfresco repository. I can upload files in Alfresco repository and can retrieve them back as well. Now I added deleting functionality using CMLDelete.
But when i delete from my API it shows in DB that file removed.
To reconfirm i can check by putting index in download txtfield n says no file exist (hence deleted).
BUT it stays in ContentStore folder and cover my HardDisk space. It doesn't go either to contentstore.deleted. it just stays in contentstore folder.

I want it to remove fully from HardDisk as well. Now i hope you understood my problem?????

If there's anyway I can do, delete permanently through my API. then please let me know.

Thanks for your reply i hope u understood my problem and you'll help me out soon…
THANKS

sham

heiko_robert
Star Collaborator
Star Collaborator
Hi sham,

have you read the wiki article http://wiki.alfresco.com/wiki/Content_Store_Configuration#Cleaning_up_Orphaned_Content_.28Purge.29 as I mentioned?
In this page the content livecycle is explained and examples how to change the behavior.
In short words: If you delete a content object only the database entry will be marked as deleted and the binary object will stay on the disc until contentStoreCleaner is fired. The contentStoreCleaner determins the files to be deleted (protectDays is defaulted by 14 days).
So, If you don't change the config: the file will be moved to contentstore.deleted 14 days later. You can change the bean to delete the content instead to move and not to wait 14 days but the cleanup job is called by a quarz job only once a day. In 3.2 you can configure eager cleanup - whicht means the content is deleted after transaction. But you should be aware that this means you can't do a online backup since there is no more retention time to do the database backup.

Regards
heiko

shamabbas
Champ in-the-making
Champ in-the-making
Thanks alot for your reply. I made change in
..\jboss-4.2.3.GA\server\default\deploy\alfresco.war\WEB-INF\classes\alfresco
"content-services-context.xml" file and set protectdays=1; So hopfully after a day it'll shift to content.delete folder from contentstore.
And as somewhere i read that in Linux files will be deleted themselves from contentdelete folder but not in windows. In windows we'll have to do it manually? I also read about to make my batch file which we dont want to do.
Another thing i would like to know that if want to restore files which are shifted to contentdelete folder what is the way to retrieve them back in contentstore folder? I hope there will be?

I really apprecitate your previous replies and help i hope you'll help me more…

thanks… Smiley Very Happy

shamabbas
Champ in-the-making
Champ in-the-making
I set the schedule and set protectdays = 1; but its not working. I deleted file day before yesterday. by now it should have to move to ContetnDelete folder but it didn't neither it removed or move anywhere from contentstore folder..
Now please tell what to do?