locked
Creating a new web application with a copy of an existing content database RRS feed

  • Question

  • Hello -

    I am trying to create a new web application using a COPY of a database from a different web application.

    For example, I have a web application called http://sharepoint that has a content database called WSS_Content_Primary.
    I took a backup of WSS_Content_Primary and renamed it to WSS_Content_Secondary.

    Now I created a new web application called http://sharepoint2 with a temporary database (WSS_TEMP).   Once created, I went to 'Manage content databases' from Central Administration and removed WSS_TEMP.   I then tried adding database WSS_Content_Secondary to the new web application and got the error message below.

    How can I assign the new ID to WSS_Content_Secondary and create the web application?  I just have to make sure that it doesn't cause any interference with the main web application.  Is it better to try copying to different SharePoint environment?

    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.

    Friday, May 15, 2020 3:18 PM

Answers

  • I ended up creating a new temp SP farm and that allowed me to add the content database.   Sites showing up fine now. 
    • Marked as answer by XRS Monday, May 18, 2020 5:00 PM
    Monday, May 18, 2020 4:32 PM

All replies

  • Use the below command to mount your database in your SharePoint farm, try running under SharePoint Management Shell.

    Mount-SPContentDatabase "Your_Database_Name" -DatabaseServer “C4968397007" -WebApplication "Your_WebApp_URL" -AssignNewDatabaseId

    Thanks & Regards,


    sharath aluri

    Friday, May 15, 2020 3:34 PM
  • Thanks.  Showing current number of sites at 0 though.

    Id               : 811ccaea-70a4-44ee-aa5d-8780bff085cb
    Name             : WSS_Content_Secondary
    WebApplication   : SPWebApplication Name=SharePoint - 29682
    Server           : SQL02\SharePoint
    CurrentSiteCount : 0

    Friday, May 15, 2020 3:58 PM
  • Seems like this content database has no sites at all ? Make sure you are doing it for correct SQL Instance.

    Thanks & Regards,


    sharath aluri

    Friday, May 15, 2020 4:59 PM
  • It's got hundreds of sites and is a couple hundred GB in size.  Seems like other folks have had similar type issues.

    https://sharepoint.stackexchange.com/questions/29719/content-database-shows-no-site-collections

    Friday, May 15, 2020 5:32 PM
  • Are you able to browse the sites from the browser ? 

    Thanks & Regards,


    sharath aluri

    Friday, May 15, 2020 5:39 PM
  • I ended up creating a new temp SP farm and that allowed me to add the content database.   Sites showing up fine now. 
    • Marked as answer by XRS Monday, May 18, 2020 5:00 PM
    Monday, May 18, 2020 4:32 PM
  • Hi XRS, 

    Thanks for your sharing. 

    Best Regards, 

    Lisa Chen 


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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, May 19, 2020 1:29 AM
  • Hi XRS, 

    I’m pleased to know your issue is solved. 

    Here I will provide a brief summary of this post for your information.

    Question:
    ====================
    The attach operation cannot continue because another object in this farm already contains the same ID When creating a new web application with a copy of an existing content database

    solution:

    ====================

    Solution is: 

    Creating a new temp SP farm and that allowed to add the content database.

    Best Regards, 

    Lisa Chen 



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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, May 25, 2020 6:23 AM