I have two content databases: Cdb_A (in Server_A) and Cdb_B := Cdb_A + (a lot of content changes) in Server_B. Im trying to host both in the Server_A but on different webapps.

My Webapp_A is attached to Cdb_A. This is working fine.

In Server_A (my target server) I created a new Webapp_B (with or without a default site collection) with a default content database Cdb_Temp. Then did the following:

dismount-spcontentdatabase Cdb_Temp;
[in sql server, restore Cdb_B, provide correct permissions];
mount-spcontentdatabase Cdb_B -webapplication "http://webapp_B"

This ends up with CurrentSiteCount: 0 (even though Cdb_B obviously has a site collection)

But if I try this, it works:

dismount-spcontentdatabase Cdb_A
mount-spcontentdatabase Cdb_B -webapplication "http://webapp_A" 
(ie Mounting Cdb_B to an existing webapp works)

Now CurrentSiteCount: 1

In effect, I'm not able to attach a content database to a new web application, possibly because there is already a similar content db?

  • I think after reading a bit I realize that I cannot have two site collections with same guid in the same farm. Even though my content database are different, they are all based off same site collection. This url helped me understand a bit: social.technet.microsoft.com/Forums/en/sharepointadmin/thread/… Appreciate if experts can clarify or confirm.
    – vasya10
    Commented Apr 14, 2011 at 4:02

1 Answer 1


Yes, that is correct - you can't attach two copies of the same content database in the farm because the various GUIDs will be the same. Unfortunately the error messages you get when you do this are not especially helpful.

The workaround for this is to create a temporary farm somewhere and attach the database there - then back it up from that farm. This gives you a fresh set of GUIDs when you restore on the original farm.

If you just want the content, another solution is to use the unattached content database recovery option in the granular backup section in CA (SharePoint 2010 - not 2007). You can use this to get access to a copy of an existing content database or even an existing database in the same farm while it is still attached and live. You can then select the sites, lists etc. that you want and export them. The content can then be imported using PowerShell (e.g. Import-SPWeb - there is no UI for this).

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.