Home > MOSS 2007 > Landing a site collection in its own content database

Landing a site collection in its own content database

August 24th, 2007 Leave a comment Go to comments

One of the many advantages of having site collections over just sub sites is that you can create a content database for each site collection. One of the obvious advantages is when backing up or restoring different pieces of your farm that makes it easier to deal with multiple content databases rather than just a giant content database. There are many other advantages that I am not going to write about mainly because it’s been fully documented at TechNet site.

Unfortunately, there is no a straight way to tell MOSS where you want your site collections to land when you move them around or create new ones. MOSS uses a round-robin algorithm to distribute them evenly in the existing content databases. However, there is a UI trick (also used in SPS2003) which still can be used in MOSS 2007.A few days ago I was going through the same process for a client and I thought that it is not a bad idea to blog it here.

We were basically moving a site collection from DEV to QA, both environments were 32-bit, same topology and etc. In other words they were identical in many ways.

DEV :

DEV-1) Run stsadm to back up the site collection
stsadm -o backup -url http://mossdev/mysitecollecionDev  -filename c:\mysitecollecionDev.dat

DEV-2) Copy DAT file (mysitecollecionDev.dat) to QA

QA:

QA-1) Choose between QA-1-1 or QA-1-2

QA-1-1) ARE YOU MOVING IT TO AN EXISTING WEB APPLICATION?

       1) Go to content databases in central admin
       2) Choose your web application name from the drop down box
       3) Take all existing content databases offline (status=offline).
          This doesn’t actually take the Site Collections offline, but only prevents any new SiteCollections from being created in these database and that’s exactly what we want.
       4) Go to QA-2

QA-1-2) ARE YOU MOVING IT TO A NEW WEB APPLICATION?

      1) Create a new web application
      2) Go to QA-2

QA-2)Create mysitecollecionQA as an “Explicit Inclusion”  managed path (Central Administration–> Application Management–> Managed Paths)
QA-3)Create a site collection exactly in the same level as it was in DEV. In this example it should be http://mossdev/mysitecollecionQA. Make sure that the name you choose for content database at level is the name you want to keep for ever ,because we are going to overwrite into this content database
 ¼br> QA-4) Run stsadm to restore the datafile you moved earlier

stsadm -o restore -url  http://mossdev/mysitecollecionQA -filename c:\mysitecollecionDev.dat  -overwrite

QA-5) Confirm that your new site collection is created in the only online content DB that you just created and change the status for all the other databases back to online.

Categories: MOSS 2007 Tags:
  1. No comments yet.