locked
How to backup and restore multiple content dbs for a specific web application (MOSS 2007) RRS feed

  • Question

  • I've a web application which consists of 3 content dbs, now I want to take a back up and attach this back up to the ohter web application.

    I followed these steps

    stsadm -o backup -url http://servername/ -backupmethod full -filename c:\somefile.bak 

    and then I restored it as

    stsadm -o restore -url http://servername/ -filename c:\somefile.bak –overwrite

    Well, I'm able to see the new data after attaching it to the new web app. but I'm not sure whether all the content db's got attached. when I go to content database list under application management of CA, I can see only one db attached with different name.

    Can anybody specify the steps to follow...Thanks in advance


    Thanks, Hitchs
    Monday, January 9, 2012 10:51 PM

Answers

  • Hi Hitchs,

     

    Are these commands you mentioned above correct? For stsadm backup and restore commands, you can refer to this:

     

    http://technet.microsoft.com/en-us/library/cc263441%28office.12%29.aspx

     

    And in your scenario, you can try to backup three content DB one by one using the item parameter, then restore them to your web application. Then commands are like these:

     

    stsadm -o backup -directory <\\server name\folder name> -backupmethod full -item <database name>

    stsadm -o restore -directory <UNC path> -backupid <GUID from backuphistory> -item <created path from tree>

     

    Hope this helps.

     

    Thanks


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by Hitchs Wednesday, January 11, 2012 6:00 PM
    Wednesday, January 11, 2012 12:02 PM
  • Hello,

    You can attach the Content Databases to another Web Application in same Farm by first removing the association from first Web Application

    Then you can use stsadm command

    stsadm.exe -o addcontentdb

    using the Below URL:

    http://technet.microsoft.com/en-us/library/cc263422(office.12).aspx

    Case 2:

    ====================

    If You have a Different Farm in which you have to attach the Databases

    Backup the Databases from Farm 1 SQL Server and then Restore to FArm 2 SQL Server

    Then use the above Command to attach the databases

    stsadm.exe -o addcontentdb

    • Marked as answer by Hitchs Wednesday, January 11, 2012 6:00 PM
    Wednesday, January 11, 2012 3:33 PM

All replies

  • Hi Hitchs,

     

    Are these commands you mentioned above correct? For stsadm backup and restore commands, you can refer to this:

     

    http://technet.microsoft.com/en-us/library/cc263441%28office.12%29.aspx

     

    And in your scenario, you can try to backup three content DB one by one using the item parameter, then restore them to your web application. Then commands are like these:

     

    stsadm -o backup -directory <\\server name\folder name> -backupmethod full -item <database name>

    stsadm -o restore -directory <UNC path> -backupid <GUID from backuphistory> -item <created path from tree>

     

    Hope this helps.

     

    Thanks


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by Hitchs Wednesday, January 11, 2012 6:00 PM
    Wednesday, January 11, 2012 12:02 PM
  • Hello,

    You can attach the Content Databases to another Web Application in same Farm by first removing the association from first Web Application

    Then you can use stsadm command

    stsadm.exe -o addcontentdb

    using the Below URL:

    http://technet.microsoft.com/en-us/library/cc263422(office.12).aspx

    Case 2:

    ====================

    If You have a Different Farm in which you have to attach the Databases

    Backup the Databases from Farm 1 SQL Server and then Restore to FArm 2 SQL Server

    Then use the above Command to attach the databases

    stsadm.exe -o addcontentdb

    • Marked as answer by Hitchs Wednesday, January 11, 2012 6:00 PM
    Wednesday, January 11, 2012 3:33 PM
  • Also, If you don’t want to keep the content database that was generated when you have created a new web app you can use this stsadm command

    STSADM -o deletecontentdb –url <URL name> -databasename <database name> -databaseserver <database server name>

    Once you have done this you can execute the other command  stsadm.exe -o addcontentdb in order to attach the new content database.


    MCITP|MCTS SharePoint| SharePoint Performance blog
    Wednesday, January 11, 2012 6:00 PM