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?