I am trying to run Test-spcontentdatabase on a MOSS database on a SQL server (2008 R2). When I run it I get "The server instance of the database could not be found." The ULS has no more information than this.

I can connect to the SQL server with management studio just fine from my SP2010 box. I can even create a content database on the SQL box. I get network traffic on wireshark. 2 packets leaving my SP2010 box and 6 returning from my SQL box. Netmon shows no errors when that command is run on either box. The DBA sees no evidence that the powershell command is actually hitting the SQL instance.

Any ideas?

UPDATE: Just to see we ran Upgrade-SPContentDatabase and it works?! Test-SPContentDatabase does NOT?!

  • BTW using a different account, with rights freshly given to the DB can run Test-SPContentDatabase. It is obviously a SQL rights issue. It would be nice if Test-SPContentDatabase gave this error instead of what is currently gives.
    – Mike Polen
    Jul 13, 2011 at 16:20
  • Did you check for spelling errors? Does your account have permissions on that database?
    – Bas Lijten
    Jul 13, 2011 at 16:21
  • Lol, probably were typing at the same time ;)
    – Bas Lijten
    Jul 13, 2011 at 16:22

2 Answers 2


I am facing the same problem when I try to run this command. In Mycase my SharePoint 2007 content Database is not residing on the same server as that of my 2010 farm configuration database. When I ran the command "Test-SPContentDatabase" with Params Name& Webapplication I found that the SharePoint is trying to find the database on the Server hosting the Configuration database. Obviously It cannot find the database. When I provided the "-ServerInstance" parameter I was able to resolve this error.

Update: I got this error today even after specifying the ServerInstance Parmaeter and reassigning the permissions on SQL database. But I am able to resolve this issue by ruuning the following command.. Get-SPContentDatabase -ConnectAsUnattachedDatabase -DatabaseServer -DatabaseName

  • By default SharePoint will use the default Database as defined in Central Admin. The problem I ran into was caused "I think" by a defect in the test-spcontentdatabase code & a mistake by the DBA in restoring the database security.
    – Mike Polen
    Jul 29, 2011 at 11:30

I had the same issue in SPS 2010. Turns out, the content database was newer than the farm itself. For example, the content database was on Oct 2011 CU, but the farm was only on Jun 2011 CU. Soon as I upgraded the farm to Oct 2011 CU, I was able to run test-spcontentdatabase with no problems.

I tried the "get-spcontentdatabase -connectasunattacheddatase ...", but it should be noted that contentdatabase objects obtained in this manor may be assumed to be part of the Central Admin site collection. Mine was. Did me little good to run test-spcontentdatabase on the results of this get-spcontentdatabase because our CA is not also a WFE and, thus, many features are not installed there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.