none
Move SharePoint 2013 Content DB.. to another SharePoint 2013 server

    Question

  • We moved our SharePoint 2013 content DB (wss_content) from a SharePoint 2013 farm  (ServerAShpt, ServerASQL) to a new farm (ServerBShpt, ServerBSQL). Here's how we did it:

    1. Backup content DB on ServerASQL

    2. Detach content DB on ServerBShpt, then delete content DB from ServerBSQL

    3. Restored the content DB from 1) to ServerBSQL and reattach it to ServerBShpt.

    Seems to work fine but I realized that we don't know if all the web parts, etc on ServerAShpt  even exist on ServerBShpt.  From what I read this bit of Powershell should answer our question.

     

    Test-SPContentDatabase -name "test1" -webapplication http://sitename -ServerInstance "SQL2"

    I think that "test1" is a copy of the original content DB, restored on a server ("SQL2"), and the -webapplication refers to the site setup on the new SharePoint 2013. Is that correct?

    Am I mixed up! Please comment on our approach.

    TIA,

    edm2
    • Edited by edm2 Friday, April 28, 2017 1:11 AM
    Friday, April 28, 2017 12:22 AM

Answers

  • How are doing attaching and detaching.. Did you try mount and demount. If not, Please execute the following PS command.

    $SiteUrl = "Site Name"
    $CurrentContentDatabase = "Currnet Content Database"
    $NewContentDatabase = "yournewdbname"
    $DatabaseServer = "DB server name"
    Dismount-SPContentDatabase -Identity $CurrentContentDatabase -confirm:$false
    Mount-SPContentDatabase -name $NewContentDatabase -DatabaseServer $DatabaseServer -WebApplication $SiteUrl -confirm:$false

    ----------------------------------------------------------------------------

    Thanks

    Lalith

    ----------------------------------------

    Please mark as Answer, if this post solves your issue.


     
    • Marked as answer by edm2 Tuesday, May 02, 2017 1:23 AM
    Friday, April 28, 2017 12:43 AM
  • Refer below site for more details about mount/demount.

    https://technet.microsoft.com/en-us/library/ff628965%28v=office.14%29.aspx?f=255&MSPPError=-2147217396

    I used to do mount/demount database for replicating issues from production to DEV.

    ----------------------------------------------------------------------------

    Thanks

    Lalith

    ----------------------------------------

    Please mark as  Answer, if this post solves your issue.

    • Marked as answer by edm2 Tuesday, May 02, 2017 1:23 AM
    Friday, April 28, 2017 1:43 AM
  • Hi edm2,

    Your understanding about “Test-SPContentDatabase” is right, and the steps you did to move the content database to another farm is fine.

    And the “Mount-SPContentDatabase” is used to attach database to a web application, it is same when doing this in Central Administration.

    Best Regards,

    Victoria

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by edm2 Tuesday, May 02, 2017 1:23 AM
    Monday, May 01, 2017 8:28 AM
    Moderator

All replies

  • How are doing attaching and detaching.. Did you try mount and demount. If not, Please execute the following PS command.

    $SiteUrl = "Site Name"
    $CurrentContentDatabase = "Currnet Content Database"
    $NewContentDatabase = "yournewdbname"
    $DatabaseServer = "DB server name"
    Dismount-SPContentDatabase -Identity $CurrentContentDatabase -confirm:$false
    Mount-SPContentDatabase -name $NewContentDatabase -DatabaseServer $DatabaseServer -WebApplication $SiteUrl -confirm:$false

    ----------------------------------------------------------------------------

    Thanks

    Lalith

    ----------------------------------------

    Please mark as Answer, if this post solves your issue.


     
    • Marked as answer by edm2 Tuesday, May 02, 2017 1:23 AM
    Friday, April 28, 2017 12:43 AM
  • We attached\detached the content DB from inside Central Administration. I don't know what mount\dismount mean or how they differ from using CA to attach\detach approach.

    Other than mount\dismount does you code do anything different than what I described more verbosely?

    edm2

    Friday, April 28, 2017 1:10 AM
  • Refer below site for more details about mount/demount.

    https://technet.microsoft.com/en-us/library/ff628965%28v=office.14%29.aspx?f=255&MSPPError=-2147217396

    I used to do mount/demount database for replicating issues from production to DEV.

    ----------------------------------------------------------------------------

    Thanks

    Lalith

    ----------------------------------------

    Please mark as  Answer, if this post solves your issue.

    • Marked as answer by edm2 Tuesday, May 02, 2017 1:23 AM
    Friday, April 28, 2017 1:43 AM
  • Interesting. And it also appears I lucked out and didn't realize it. Because both the source and target servers are SharePoint 2013 I attached the original content DB to the new server without any issue (there is no need for an  "upgrade"). BUT if the source server were SharePoint 2010 and the target SharePoint 2013 then attaching the 2010 DB to the SharePoint 2013 DB will not upgrade the DB for SharePoint 2013 use.

    edm2

    Friday, April 28, 2017 1:58 AM
  • Hi edm2,

    Your understanding about “Test-SPContentDatabase” is right, and the steps you did to move the content database to another farm is fine.

    And the “Mount-SPContentDatabase” is used to attach database to a web application, it is same when doing this in Central Administration.

    Best Regards,

    Victoria

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by edm2 Tuesday, May 02, 2017 1:23 AM
    Monday, May 01, 2017 8:28 AM
    Moderator