An orphaned site collection is a site collection that exists in the database but not in the site map. So there is no way of navigating to it from the web browser. Usually it is the remnant of a site that was deleted or moved. You will want to make sure you have a backup of the database prior to starting this procedure; you may also take a moment to check and see if a duplicate site exists at the same url.
Stsadm –o preupgradecheck
To see if you have any orphaned site collections note the content database name that contains the orphaned site collection.
Example of orphaned site collection from preupgrade check –
– /siteurl (Data Source=<sqlServerName;Initial Catalog=<ContentDatabaseName>;Integrated Security=True;Enlist=False;Connect Timeout=15)
Stsadm –o enumallwebs–databasename <ContentDatabaseName> –databaseserver <DatabaseServer> >c:\<ContentDatabaseNameOrphans>.txt
This will generate a list of sites and webs and their respective GUIDs.
– Site Id=”cbca9688-9105-46ad-ab0b-0042a652b6eb” OwnerLogin=”Domain\user” InSiteMap=”False”
Web Id=”f368a039-a4ee-4d49-93db-91b239f03435″ Url=”/siteurl”
– Site Id=”a46cb97e-29a9-4dfc-a2e4-00c2be049756″ OwnerLogin=”Domain\user” InSiteMap=”True”
Web Id=”344f9c51-f00d-499b-a5f0-d5eaa4dfab6a” Url=”/siteurl_1″
You are looking for a web url that matches /siteurl from the preupgradecheck report. Check the line above for the site GUID (Site Id) and confirm that “InSiteMap=”False”. This is your orphaned site collection. Note the Site GUID as you will need it to continue. (Not the web GUID!) Also be sure you are confirming that “InSiteMap=”False””. It is possible that a site with the same URL might exist in the database but be correctly registering to the site map.
To remove the orphan – Since the site is not accessible from the web application it is unlikely that the content is needed. However I still strongly suggest that a current backup of this database exist before purging the site collection from the database.
To delete run;
Stsadm –o deletesite –force –siteid <SiteID/Guide noted from above> –databasename <ContentDatabaseName> –databaseserver <DatabaseServer>
It should reply “Operation completed successfully”.
You can now re-run preupgradecheck or enumallwebs to confirm that the site no longer exists.