Whilst working on a client site today to deploy the June 2012 CU to their SharePoint / Project Server 2010 farm I came across an issue in the pre-update health check. The issue was identified by the SharePoint health analyser as Missing server side dependencies. This particular missing dependency was an orphaned site in the Central Administration content database. The Help site was present in the central admin content database but not in the farm configuration. The exact error for search engines is below:
[SiteOrphan] Database [EPM2010_AdminContentDB] contains a site (Id = [d2df5cfd-26fc-419f-bd23-07b61d805bbd], Url = [/sites/Help]) that is not found in the site map. Consider detach and reattach the database. The orphaned sites could cause upgrade failures. Try detach and reattach the database which contains the orphaned sites. Restart upgrade if necessary.
The reason why this site was not created successfully or potentially orphaned after the install is unknown.
Anyway enough about the error, what about the fix? As the explanation suggestions the first option I tried was to detach and reattach the content database. I was a bit caution of doing this as it was the farm central admin content database, so I tested this on my own farm first.
Running the Dismount-SPContentdatabase command failed with the error below, probably because this content database is attached to an SPAdministrationWebApplication web application rather than a normal SPWebApplication.
Next I tried combining the Get-SPContentDatabase command and piping this to the Dismount command and that worked successfully. The example command is below:
get-spcontentdatabase -webapplication http://vm353:15000 | dismount-SPcontentdatabase
Then I ran the normal Mount-SPContentDatabase command to attach the same content database that was detached above:
Mount-SPContentdatabase -name EPM2010_AdminContentDB -DatabaseServer vm353 -Webapplication http://vm353:15000
The Central admin site opened (good start ), I then accessed the http://vm353:15000/sites/help site which prompted me to set the template. After setting the template for the site I was able to access the site without any issues. When the farm was installed I think part of the help site provisioning failed to set the site template for some unknown reason which caused the site creation to be incomplete. I then reanalysed the missing server side dependencies error and the issue was resolved, the June 2012 CU also deployed successfully.
I would strongly recommend having full SQL database backups of all farm databases and SharePoint server snapshots / images before attempting this fix.
Hopefully this will help out anyone else who comes across this error.