Web Applications and Content Databases

In SharePoint 2007, every Web Application has its own content database(s). Yes, the WebApps can contain more than one Content Database – moreover, we can change the default content DB.

Why is it important for us? Just for fun? – No, of course.
It can be important, for example, if we have to move a full site with all content. The steps of creating the new Web Application with the original content are the followings:

  1. Create the new Web Application on the Central Administration site. You have to give a name for the Content Database – as it's a temporary DB for you, call "ContentDB_Tmp".
  2. From this point forward, you can choose the Central Admin UI or stsadm. I like stsadm better, so let's see, how we can change the Content DB with the help of this command.
  3. First of all, if you're not sure in the related content DBs, run the following stsadm command:
  4. stsadm -o enumcontentdbs -url http://mymoss
    <Databases Count="1">
    <ContentDatabase Server="MYDBSERVER" Name="ContentDB_Tmp" />
  5. Now you have the exact name of the temporary content database (ContentDB_Tmp). Let's delete it!
  6. stsadm -o deletecontentdb -url http://myserver -databasename ContentDB_Tmp -databaseserver MYDBSERVER
  7. Well, currently we have an empty Web Application with no Content Database. Let's add the original one, called ContentDB_FullContent!
  8. stsadm -o addcontentdb -url http://myserver -databasename ContentDB_FullContent -databaseserver MYDBSERVER
  9. That's all! To check your results, run the following command again:
  10. stsadm -o enumcontentdbs -url http://mymoss
    <Databases Count="1">
    <ContentDatabase Server="MYDBSERVER" Name="ContentDB_FullContent" />

Leave a Reply

Your email address will not be published. Required fields are marked *