I am sure you have seen enough blog posts on this and so I thought will add one more to the ever growing list!!
So for last few days I have been working with one my my colleagues to install and Configure Enterprise Portal (AX 2009) with SharePoint 2007 Farm (1 WFE + 1 App Server connecting to SQL) – it’s a different war altogether but let me tell you how we landed up with multiple orphan site collections. EP was failing to install every time (and we did this at least 10 times) since it could not create the site collation with the Custom Site Definition. we finally got around it, but in the process EP installer was invoking a web service to create the namespace every time >> http://<sharepointSiteDNSName>/sites/DynamicsAX .
Finally when the EP installation completed successfully we could not browse the EP Role Center Site. after few hours of banging our head we finally went in SQL (ContentDB >> Site table) and saw a bunch of entries which shouldn’t be there >> Touching SQL Content Db in SharePoint is not supported – so don’t do it, I will tell you how to find orphan sites without touching SQL.
when you run stsadm –o databaserepair command – it shows the orphan items in a content DB .. however, our showed 0, reason being, there wasn’t anything in the content DB per say. so what to do??
Make sure you have SP2 for MOSS first.
There are primarily two ways to find this out.
ok so we found the orphan addresses, now clean up time. Since attach / detach and databaserepair with deletecorruption switch didn’t help us, we decided to manually delete the Sites with SiteID. if you note above, EnumAllWebs shows the GUID of the Sites that we will use to delete them and clean up the WebApp The command to run here is : (copy site ID from above output for all of them where InSiteMap=False) - http://technet.microsoft.com/en-us/library/cc288016(office.12).aspx
stsadm -o deletesite -force -siteid 40ca628e-8d7c-461b-9340-c5bb518cf399 -databasename wss_content_ep -databaseserver sql08W2008X64
That did it!! to Verify, we ran preupgradecheck again and it didn’t report any Orphan Site Collections.
Hope this helps.