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

homer-doh

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
   tentDatabase


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

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

Comments are closed.