none
Want to restore recent production backup content db into Dev Farm but both contain the same site collections. RRS feed

  • Question

  • Here is my scenario: 

    My current dev sharepoint 2013 environment is using a former backup of Production (which is 2010). We need to restore the latest backup from production into the dev environment. I restored the production backup to a new database under a different name. When I use "Mount-spContentDatabase" and point towards the latest production backup under a new name it gives me the error:

    "

    Mount-SPContentDatabase : The attach operation cannot continue because another
    object in this farm already contains the same ID. Each object in a farm must
    have a unique ID. In order to proceed with the attach operation you must
    assign a new ID to this database. To attach this database with a new ID, use
    the Mount-SPContentDatabase command with the -AssignNewDatabaseId parameter.
    Note that if this new database and an existing database contain the same site
    collections, attaching this database will likely result in orphaned site
    collections due to conflicts between the two databases." 

    I realize mounting the same content db's in one farm leads to a duplication of database and site collection GUIDS in the sql database. I guess my question is what is the easiest way to restore a content db with the same site collections and ID. 

    Should I "disconnect" the current dev content db, take a backup of it, delete it from sql server, and then mount the newest production backup or will that still give me the same "orphaned" site issue?

    Should I do the above, delete the web application, create a new one and then try to mount latest production backup?

    If someone could give me specifics on how this can be accomplished short of installing on a new farm that would be much appreciated!


    Monday, March 24, 2014 2:59 PM

Answers

  • when restoring a content database,

    ALWAYS detach the old content database... THEN attach the replacement content database.

    Regardless of whether the IDs match, the paths would clash.


    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

    • Marked as answer by againeyuga Thursday, March 27, 2014 1:16 PM
    Monday, March 24, 2014 3:05 PM

All replies

  • when restoring a content database,

    ALWAYS detach the old content database... THEN attach the replacement content database.

    Regardless of whether the IDs match, the paths would clash.


    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

    • Marked as answer by againeyuga Thursday, March 27, 2014 1:16 PM
    Monday, March 24, 2014 3:05 PM
  • for what it's worth, here's the script I use when I refresh DEV from PROD: http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Script_-_Restoring_a_Content_Database

    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

    Monday, March 24, 2014 3:09 PM
  • Scott thank you for the quick reply. So when I detach the current content db and remove it from sql server or take it offline. If I then go to restore the latest copy of production in my farm to the same web application will the database ID error be an issue any longer? Or if the current db is removed or taken offline does it allow the newer backup I want to mount use the same ID's without an issue? Thanks for the script. I'm kind of new to moving content db's so any clarification would be great.
    Monday, March 24, 2014 3:15 PM
  • Once you detach it from Sharepoint, so all the site information gone from Config DB. No need to delete it from SQL but you can if you need free space on the SQL.

    After detaching old DB from sharepoint and mount the new DB to web application...you will not get the ID error.


    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

    Monday, March 24, 2014 3:46 PM
    Moderator