We help IT Professionals succeed at work.

How to how find an orphaned site in SharePoint

gtrapp asked

I ran the follow command in PowerShell:
Test-spcontentdatabase -name wss_content -webapplication http:// servername

And I have the results in the code. How do I find the orphaned site that the results say is in the content database?

Category        : SiteOrphan
Error           : True
UpgradeBlocking : False
Message         : Database [wss_content_tum] contains a site (Id = [435e0d9b-7224-4799-90b4-1c1450152b87], Url = [/]) whose url is already used by a different site, in database (Id = [90642c98-8a14-4368-bc2b-442cfd8a15a7], name = [WSS_Content]), in the same web application. Consider deleting one of the sites which have conflicting urls.

Remedy: The orphaned sites could cause upgrade failures. Try detach and reattach the database which contains the orphaned sites. Restart upgrade if necessary.

Open in new window

Watch Question

Director, Technology Solutions
by Message I can see that it is root site of orphaned site collection so I would use
stsadm –o deletesite -siteid <site ID> (from test output) -databasename <database name> -databaseserver <database server name> -force

PS please be sure you have backup to roll it back if needed!

PPS looks like it will not block the upgrade so you can live with it