Situation: Using stsadm -o enumallwebs -includewebparts returns a list of webparts. One of which I want to remove across the entire site.

Issue: Using the GUID I can find the webpart Page ID, and then look up the location and page name in the AllDocs table. So far so good. Except: The page is missing! It has been deleted.

How do I: Get the Page back so that I can remove the WebPart? As it will always remain in the stsadm -o enumallwebs -includewebparts results.

Migration to 2010: Will this be an issue when I migrate to SharePoint 2010? Which is why I'm 'cleaning up' the site in the first place.

Many thanks in advance! I hope that someone has run into this problem before and has a simple solution.

2 Answers 2


You are doing the right thing in trying to clean up your farm before migrating to SharePoint 2010. This will save you much heartache later on.

When content is deleted it is not necessarily removed immediately and may depend on timer jobs to clean up content that has been flagged for deletion. The other possibility is that the pages or sites have become "orphaned" in that they exist in the content db but nothing links to them. There are a few stsadm commands to deal with these issues:

stsadm -o databaserepair -deletecorruption -databasename WSS_Content -url http://portal.mycorp.local/


stsadm -o forcedeletelist

stsadm -o deletesite -force

These are powerful commands - make sure you take a backup before running them, just in case.

  • Thanks for the suggestions but the issue still prevails! The Web Parts that I want to remove are on Pages/Lists that have been deleted so these commands are not cleaning anything up. Mar 3, 2012 at 22:21
  • Is it possible to delete the records from the AllDocs table, or will that break something? Mar 3, 2012 at 22:23
  • 1
    Please don't do that! That is unsupported and high risk. Another thing you can try is detaching and reattaching the content databases. After you have done your best to clean up, try setting up a test SP2010 farm and mount and upgrade the database(s) - the problem may go away. I assume you have tried things like retracting the solution and iisreset, etc.
    – SPDoctor
    Mar 4, 2012 at 8:40

So, the solution was to simply delete the offending rows in the AllDocs table. I was afraid of doing this in case something went wrong, so I did a backup first! Then researched the AllDocs table a bit more and found a blog were this was explained. Now all is well :-) Thanks to SPDoctor for taking the time to comment.

Thanks Dave

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.