cancel
Showing results for 
Search instead for 
Did you mean: 

Lost files from filesystem

mauro_lorenzutt
Champ in-the-making
Champ in-the-making
Hi all,

yesterday a customer of mine did an error: he deleted some folders inside the contentstore folder… He deleted some folders like
contentstore/2009/7/20
contentstore/2009/7/21
contentstore/2009/7/22

Since the documents contained in those folders are not so important, we'd like to synchronize the database by clearing the entries pointing to the lost files.

Is it possible? Is there any procedure to synchronize the database with filesystem in case of lost physical files?

We are using Alfresco community version 3.1

P.S. Restoring a previous backup is not an option…

Thank you in advance.

Mauro
4 REPLIES 4

rogier_oudshoor
Champ in-the-making
Champ in-the-making
Wow, you have one stupid client there  Smiley Very Happy

You have to write your own crawler to check every file & cm:content property and your content, version, archive and avm stores to check if they still match in Java, and deleted whatever is gone.

mrogers
Star Contributor
Star Contributor
You don't neccessarily need to crawl through all your data.  The folders in the content store repository correspond to dates, so your client lost 3 days worth of content. You may be able to search for all nodes created on those particular dates which will at least tell you which files you have lost.

But the most important thing (for any IT system, including alfresco) is to make sure backups are being made.

mauro_lorenzutt
Champ in-the-making
Champ in-the-making
You don't neccessarily need to crawl through all your data.  The folders in the content store repository correspond to dates, so your client lost 3 days worth of content. You may be able to search for all nodes created on those particular dates which will at least tell you which files you have lost.

But the most important thing (for any IT system, including alfresco) is to make sure backups are being made.

Thank you very much. I'll try to find out all the pending records and clean up the db.
Anyway, can you confirm that when I finished the cleaning everything starts to work fine again? Or is it possible that something was corrupted and will not be repaired after this operation?

In the mean time, I replaced that folders with a very old backup (maybe every file was there, I can't guarantee it…) and I rebuilt the Lucene index. Now I get the following exception in some folders:

javax.faces.FacesException: org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/d3bf11fa-34ed-2341fefedfdf

P.S. I know that a backup is important but someone doesn't give the right importance to backups… Now I'm sure that it will be a priority 😉

Mauro

mrogers
Star Contributor
Star Contributor
You need the content store And the database backup together.  
Either one without the other is not going to work.

However if you do have a backup of the filesystem then you can simply copy the missing folders from backup.   Problem over!

However assuming that you really don't have a backup then take a backup of both database and content store before you touch the live alfresco system!    And install that backup onto a test system so you can check whether your proposed changes work.

What you are missing is the content for some of your nodes.    There's no worry about any "corruption", your database is intact.    And your content store is fine as well except for a missing few folders.

Your first task is to do some analysis to identify which nodes have a problem.
And what are the associations to those problem nodes.

You may be able to "fix up" the content or delete the problem nodes.