I have a backup of content database (*.bak) file. I have one web application running it now. However I have restored it again under different name on my SQL Server. I would like to create another web application using a copy of the same content database. It however comes up with an error

"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 have tried using -AssignNewDatabaseId however when It attached my content database it was showing that there are 0 Current Number of Site Collections.

  • I thought it might be good idea to change existing content's database GUID so that I can create new web application with backup.

Is that even possible?

1 Answer 1



First of all never change anything inside a SharePoint Content Database. Concerning the "0" number of site collections it may happen due to permissions and conflict of internal SID for the dbo user for a restored content database.

Here is what can you do and it should work just fine provided that your content database is not exceeding 15GB.

  1. Take a stsadm -o backup "webappurl" -filename "yoursitecolleciton.bak"

  2. Create a new web application and create a site collection at the root.

  3. Restore the backup with -overwrite option. SharePoint takes care of the rest and your sites should work just fine from there on both web applications.

Incase your content database is fairly large in size around 100 GB in that case you need to follow these below steps:-

  1. Restore the content database to a different farm of the version.

  2. Rename the content base on the restored farm's SQL Server by taking the database offline.

  3. Attach the renamed content database to the farm.

  4. Use -AssignNewDatabaseId to this database.

  5. Take a SQL Backup of the content database from there on.

  6. Restore this content database backup on your current farm and attach it it to the second web application.

Try this and let us know if you encounter any issues.

  • Hi Moss, how do you use -AssignNewDatabaseId ? Is it when I mount content database back in?
    – Luke
    May 31, 2012 at 20:56
  • Can you also explain where the 15gb limit comes from? Our test has 5gb but production has over 200gb of content.
    – Luke
    May 31, 2012 at 21:43
  • Hi Luke, please have a look at this discussion concerning the size limits of the backups taken with both stsadm social.technet.microsoft.com/Forums/en-US/sharepointadmin/…
    – ArkoD
    Jun 1, 2012 at 6:55
  • Yes after you mount the database back and you can assign newDB ID
    – ArkoD
    Jun 1, 2012 at 6:56
  • In the first backup step, you are missing the -url parameter. Should be: stsadm -o backup -url "webappurl" filename "yoursitecolleciton.bak" Aug 15, 2012 at 6:04

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.