Mount-SPContentDatabase failing at mounting SP2007 database to SP2010

Answered Mount-SPContentDatabase failing at mounting SP2007 database to SP2010

  • Friday, May 11, 2012 5:03 PM
     
     

    Hello all hoping someone can assist with something I've been dealing with for a few days.

    We are migrating from a all-in-one server running Win2003 r2 server, SQL 2005, and SP 2007.

    We are now migrating to a Farm setup multiple Win2008 r2 servers, one running SQL 2008 r2, and one running IIS and SP 2010 (Hyper-V).

    I've run the pre-upgradecheck and all looks well (HTML report), I've then copied the database to our new server 2008 r2 server using SQL import/export wizard.

    Then from the SP2010 server I ran the Test-SPContentDatabase command reporting back a few missing solutions/features/addon's. I was able to get all the solutions/web parts/features installed and the test report comes back blank, so I think I'm good on that.

    BUT

    After I have removed the default WSS_Content database in Central Admin and trying to perform the Mount-SPContent Database command I get the following:

    Anyone have any ideas or next steps I can take to trouble shoot this?

All Replies

  • Friday, May 11, 2012 5:08 PM
    Moderator
     
     

    You need to run Upgrade-SPContentDatabase WSS_Content_Test -DatabaseServer U15739966 -WebApplication http://sharepoint -UpdateUserExperience

    http://technet.microsoft.com/en-us/library/ff607813.aspx


    http://sharepoint.nauplius.net

  • Friday, May 11, 2012 6:01 PM
     
     

    Trevor,

    Tried the Upgrade-SPContentDatabase command still no luck. Initially I think some of the parameters you have were incorrect (there is no parameter for -DatabaseServer) so I looked at the technet article you listed (Thanks) and tried this ammended command:

    Upgrade-SPContentDatabase WSS_Content_Test -WebApplication https://sharepoint01:80/ -UpdateUserExperience

    And it returned the following error:

    So I'm still not sure what I'm missing here.


  • Friday, May 11, 2012 6:03 PM
    Moderator
     
     

    Odd, try specifying:

    -ForceDeleteLocks:$true


    http://sharepoint.nauplius.net

  • Friday, May 11, 2012 6:18 PM
     
     

    Still no go. similiar/same erorr message.

  • Friday, May 11, 2012 6:19 PM
    Moderator
     
     
    Sorry, it should be -ForceDeleteLock (no plural).  In PowerShell, if you do a -Force then hit the tab key, it will cycle through all applicable parameters so you don't have to type it out manually.

    http://sharepoint.nauplius.net

  • Friday, May 11, 2012 6:48 PM
     
     

    No problem, (thanks for the tip, tab through parameters) but still receiving errors.

    I also tried to go through the automated process with just a straight Upgrade-SPContentDatabase it still fails at supplying the identity parameter.

    It's almost as if it's not seeing the database or I'm not specifying it correctly. Although I can assure you it does exist and I am listed as the owner:

  • Friday, May 11, 2012 6:51 PM
    Moderator
     
     

    Is WSS_Content_Test on the Default Database Server?  You might try:

    $db = Get-SPContentDatabase -Id WSS_Content_test

    Upgrade-SPContentDatabase -Id $db {...}


    http://sharepoint.nauplius.net

  • Friday, May 11, 2012 7:22 PM
     
     

    It's odd I perform the Get-SPContentDatabase -Id WSS_Content_Test and it's reporting back "The content database could not be found."

    But if I perform a command like Test-SPContentDatabase and specify the database (WSS_Content_Test) it will succesfully find the DB and run the test.

    The WSS_Content_Test is on a different physical server then what we have IIS/SP2010 runnning from. Do you think this is the issue? When I did the initial SP2010 wizard config I did specify in the farm setup to use the server I have WSS_Content_Test as the default SQL server.

  • Friday, May 11, 2012 8:19 PM
    Moderator
     
     

    Question, is this database in single user mode or read-only mode on the SQL Server?

    I would specify -ServerInstance <SQLSERVERNAME\INSTANCENAME> (specify the instance name if not using the default instance) and try that.


    http://sharepoint.nauplius.net

  • Monday, May 14, 2012 3:01 PM
     
     

    Trevor,

    I did verify that the DB is set to Multi-User Mode and the Read-only value is set to false.

    Can you clarify the -ServerInstance switch and show me a full example. I'm stuck on the specification of "InstanceName" would this be relative to the SQL Server Name?

    Command Like: Upgrade-SPContentDatabase -ServerInstance (SQL Server Name) -identity (Name of the database to be upgraded) -WebApplication (SP Web URL) -UpdateUserExperience

    Thanks,
    Ron

  • Monday, May 14, 2012 5:53 PM
     
     

    On an added note I tried both the Mount-SPContentDatabase and the older stsadm.exe -o addcontentdb command both of which fail with the following:

    Exception of type 'Microsoft.SharePoint.Upgrade.SPUpgradeException' was thrown.

    Is there any log files or event that would give me more information on why this is failing? It seems to be getting to a point where it is searching out the correct SQL server, in my case our server U15739966, but then when trying to mount the DB WSS_Content_DB it throws this exception error.

    I'm at whits end on this one.

  • Monday, May 14, 2012 5:55 PM
    Moderator
     
     

    Was MOSS 2007 upgraded to SP2 or later (and Config Wizard ran after upgrading)?

    You should be able to check the ULS logs in \Program Files\Common Files\Microsoft Shared\web server extensions\14\LOGS\.  The ULS logs should contain the above error, and perhaps more information.


    http://sharepoint.nauplius.net

  • Monday, May 14, 2012 6:51 PM
     
     

    Our MOSS 2007 server is at: 12.0.0.6520 (SP2 + October 09 cumulative Update KB974989 + KB974988) not sure if the config wizard was run after the upgrade, is there a way to find out?

    I did check the ULS logs and here's some possibly relavent information after attempting the Mount-SPContentDatabase command:

    Error Log

    I'm seeing a lot of statements about "Cannot insert the value of NULL into column..." I'm not sure why this DB is having an issue or the upgrade is unable to update/edit the DB.

  • Monday, May 14, 2012 6:58 PM
    Moderator
     
     Answered

    On MOSS 2007, you might want to try and run:

    stsadm -o databaserepair with the deletecorruption option (backup the database first):

    http://technet.microsoft.com/en-us/library/cc263282(v=office.12).aspx

    It has been awhile, but in Central Admin on MOSS 2007, if you go to Manage Servers, it should indicate whether an upgrade needs to happen or not.  If no upgrade is pending, then someone ran the Config Wizard successfully.


    http://sharepoint.nauplius.net

  • Monday, May 14, 2012 8:36 PM
     
     

    Well I did run stsadm -o databaserepair but only with the -databaserepair opton, it only reported back the following:

    <OrphanedObjects Count="0" />

    I'm hesitant to run the full deletecorruption string as I do not manage the backup's, this is our current active production site and the individual that does our backup's is out for a few days. I will follow-up when I can verify we have good backup's and after running the deletecorruption command.

    Also I did verify that there is no pending upgrade status on the 2007 site so it looks like at least the last update they ran did fully take effect (which means it is post SP2 compliant)

    Thanks again for your advice and assistance. I hope to figure this out at some point and it helps others.

    Ron

  • Monday, May 21, 2012 6:51 PM
     
     Answered

    Found out what my issues was, it seems the method I used to export the data from SQL 2005 to SQL 2008 was corrupting or otherwise damaging the DB and it's data not allowing the SP-mount command to work properly.

    I made a complete back-up of the Content database saved to a file and then moved this to the new SQL server where I then imported the data.

    I was then able to perform the SP Mount command succesfully were it upgraded the DB on it's own and the site is now viewable.

    Thanks everyone for your assitance.