Error Cannot complete action when restoring a sharepoint site - possible cause : Orphaned site

Its interesting when you wonder why you can't restore your backed up sites when trying to restore a site using the stsadm and you keep getting error:

Cannot complete action . Please Try again

I will start by sending to Keith site which actually explains what orphan sites are and how you can avoid them.
Unfortunately in my own case there was nothing to avoid i guess the database just got corrupted
What i did was delete a site collection from the sharepoint Central Admin and that was it any time i try to restore to the site i deleted i get the error and when i try to create a site with the same name its tell me the site collection already exist and advices me to use another name.

And funny enough i can see still the site collection listed in the sitel collection list in my admin config

But the point is i never gave up and i WANT TO USE THE SAME SITE NAME

So  started digging into the stsadm cmd and i found a handy cmd called databaserepair which goes like like this below:

stsadm -o databaserepair -url http://MySharepointServer/sites/mySharepointSite -databasename YourdatabaseName

running the command above will list your sites and lists etc that are orphaned cool isn't it

and then when you use the  -deletecorruption
 
like bellow it will delete the corrupted data

stsadm -o databaserepair -url http://MySharepointServer/sites/mySharepointSite -databasename YourdatabaseName -deletecorruption

and you should see a similar  result in xml format with a deleted attribute that equals to YES

<OrphanedObjects Count="22">
  <Orphan Type="SPSite" Id="{E732BEEC-F4BD-40D7-A51F-7B33BA7D5698}" Deleted="Yes
" />

And i said to myself hmm... problem solved.

So i went back to the sharepoint Central Admin to create the site and bingo the error again

So as far as i know the only thing that worked for me if you check out Keith's blog  above is :

You need to basically remove and re-add the Content Database that the Configuration Database an entry for.  When the content database is removed from the virtual servers list of content databases, clean up logic is performed to remove the entries from the Configuration database.  You then simply re-add the content database back in, and the sites from the content database are re-added to the configuration database.

And that did the trick

You can also see more troubleshoting here

posted @ Tuesday, May 20, 2008 7:24 PM

Print

Comments on this entry:

# re: Error Cannot complete action when restoring a sharepoint site - possible cause : Orphaned site

Left by Milton Harper at 8/8/2008 2:21 AM
Gravatar
I'm in the same boat you described above. We were restoring a site and hit Ctrl-C and ended up corrupting ourselves. I have run the database repair commands to remove the orphaned objects (now 0) but I still can't create a site with the same older name and I still see <Site Error="The system cannot find the path specified. (Exception from HRESULT: 0x80070003)"> when i run the enumsites command. I recall when we first started, we had to detach/attach the content db but don't recall the commands. I don't see them listed above. Could you post those.

# re: Error Cannot complete action when restoring a sharepoint site - possible cause : Orphaned site

Left by Peter Ekerot at 1/14/2009 10:04 PM
Gravatar
I had the same problem. Running these commands fixed it:

stsadm -o deletecontentdb -url http://%COMPUTERNAME% -databasename WSS_Content

stsadm -o addcontentdb -url http://%COMPUTERNAME% -databasename WSS_Content

# re: Error Cannot complete action when restoring a sharepoint site - possible cause : Orphaned site

Left by Patrick at 1/15/2009 10:55 AM
Gravatar
Peter,
Yeah and thanks for the cmd.I was supposed to post that earlier.But i mentioned it in the last statement of my post.
Thanks

Your comment:



 (will not be displayed)


 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345