cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED]recover a deleted site?

steves
Champ in-the-making
Champ in-the-making
Hi,

my problem is as follows:

we have deleted a site, and it's now in the archive space. I can see it trough the trashcan, but if I try to recover it alfresco gives me an exception:

2012-07-23 12:53:19,702  ERROR [node.integrity.IntegrityChecker] [http-8080-48] Found 1 integrity violations:
Mandatory aspect not set:
   Node: workspace://SpacesStore/f755fb6e-1637-40d1-8c6e-f14d2ae6b13e
   Type: {http://www.alfresco.org/model/site/1.0}site
   Aspect: {http://www.alfresco.org/model/system/1.0}undeletable
2012-07-23 12:53:20,398  ERROR [node.archive.NodeArchiveServiceImpl] [http-8080-48] An unhandled exception stopped the restore
org.alfresco.repo.node.integrity.IntegrityException: 06234456 Found 1 integrity violations:
Mandatory aspect not set:
   Node: workspace://SpacesStore/f755fb6e-1637-40d1-8c6e-f14d2ae6b13e
   Type: {http://www.alfresco.org/model/site/1.0}site
   Aspect: {http://www.alfresco.org/model/system/1.0}undeletable


my alfresco version is 4.0d co

As I've read this missing aspect ("undeleteable") is set by the site service and it can only be done there.
Any idea on how to recover a delete site?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

this appears to be a bug - the undeletable aspect should still be present when the node is transferred to the archive. This may have something to do how the SiteService supresses the behavior - this also supresses the copy of the aspect, which then leads to an inconsistent state in the archive as the aspect is configured as being mandatory.

You should be able to reconstruct your site after a JavaScript-based modification while it is still in archive. Write and execute a script action that re-adds the aspect on the site node before trying to recover it.

Regards
Axel

steves
Champ in-the-making
Champ in-the-making
Thanks a lot Axel!

This worked: execute a simple script (in the admin console for example):

var node = search.findNode("archive://SpacesStore/f755fb6e-1637-40d1-8c6e-f14d2ae6b13e");
logger.log(node.name + " (" + node.typeShort + "): " + node.nodeRef);
node.addAspect("{http://www.alfresco.org/model/system/1.0}undeletable");

and then recover (for example with curl):

curl -X PUT -u ADMIN_USER:ADMIN_PASSWORD "http://alfrescohost/alfresco/service/api/archive/archive/SpacesStore/f755fb6e-1637-40d1-8c6e-f14d2ae..."