Mount-SPContentDatabase and Test-SPContentDatabase fail with either Invalid object name ‘Sites’ or ‘Webs’


While trying to restore some SharePoint 2010 “content” databases I kept on getting errors about invalid objects… Found some links talking about incorrect SharePoint versions but as it turned out that all it was because the databases were service application database backups with slightly ambiguous names, not content databases.

The Error

Mount-SPContentDatabase : Invalid object name ‘Sites’.
At line:1 char:24
+ Mount-SPContentDatabase <<<<
    + CategoryInfo          : InvalidData: (Microsoft.Share…ContentDatabase:
   SPCmdletMountContentDatabase) [Mount-SPContentDatabase], SqlException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMountCon

Test-SPContentDatabase : Invalid object name ‘Webs’.
At line:1 char:23
+ test-spcontentdatabase <<<<  -name WSS_Search_Server01 -webapplication
    + CategoryInfo          : InvalidData: (Microsoft.Share…ContentDatabase:
   SPCmdletCheckContentDatabase) [Test-SPContentDatabase], SqlException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletCheckCon

The Fix

Don’t restore service application databases and try to mount them with content database mount and test commands. Try and find out exactly what they are first. Winking smile