Microsoft KB Archive/829112

= How to back up and restore http://companyweb data in Windows Small Business Server 2003 =

Article ID: 829112

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Windows Small Business Server 2003 Premium Edition
 * Microsoft Windows Small Business Server 2003 Standard Edition
 * Microsoft Windows SharePoint Services 2.0

-





SUMMARY
This article discusses how to back up a Windows SharePoint Services 2.0 http://companyweb database in Microsoft Small Business Server 2003 and how to restore the database back to the original server. You can do the backup and the restore operations by using Microsoft Windows NT Backup or by using the Stsadm.exe command-line tool.

For these steps to work, you must meet the following criteria:
 * You must restore the database to the same server where you performed the backup operation.
 * The following Windows SharePoint Services 2.0 database and log files must be on the server:
 * STS_Config.mdf
 * STS_Config_log.ldf
 * STS_Servername_1.mdf
 * STS_Servername_1_log.ldf

Back up and restore a Windows SharePoint Services http://companyweb database by using Windows NT Backup
 To back up the Windows SharePoint Services 2.0 http://companyweb database by using Windows NT Backup, follow these steps:  Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Backup. In the Backup or Restore Wizard, click Advanced Mode, and then click the Backup tab. Click to select the check box of the folder where the Windows SharePoint Services 2.0 databases are installed. By default, this is \Program Files\Microsoft SQL Server\MSSQL$SharePoint\Data.

Note This is the default installation folder for Windows SharePoint Services 2.0 databases. Specify a destination for the backup, and then click Start Backup.  To restore a Windows SharePoint Services 2.0 http://companyweb database by using Windows NT Backup, follow these steps:

Note This action overwrites the existing Windows SharePoint Services 2.0 databases. We recommend that you back up the current \Program Files\Microsoft SQL Server\MSSQL$SharePoint\Data folder before you restore files.  Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Backup.</li> In the Backup or Restore Wizard, click Advanced Mode.</li> Click the Restore and Manage Media tab.</li> Select the tape drive or other backup storage device that contains the http://companyweb database(s) that you backed up in step 1.</li> Click to select the check box of the folder where the Windows SharePoint Services databases are installed. By default, this is \Program Files\Microsoft SQL Server\MSSQL$SharePoint\Data .</li> On the Tools menu, click Options.</li> Click the Restore tab, click to select the Always replace the file on my computer check box, and then click OK.

</li> Verify that Restore Files to is set to Original location, and then click Start Restore. Click OK to start restoring your data.

Note After you click Start Restore, you can click Advanced in the Confirm Restore dialog box. We recommend that you do not make any changes to the default advanced restore options until you know that the restore was successful.

For more information about advanced restore options, visit the following Microsoft Web site:

</li> When the restore is complete, click Close in the Restore Progress dialog box, and then click Yes to restart the server.</li></ol> </li></ol>

Back up and restore a Windows SharePoint Services http://companyweb database by using the Stsadm.exe command-line tool
 To back up a Windows SharePoint Services 2.0 http://companyweb database by using Stsadm.exe, follow these steps:  Click Start, and then click Run.</li> In the Open: box, type cmd, and then click OK.</li> At the command prompt, type the following, and then press ENTER:

\Common Files\Microsoft Shared\web server extensions\60\BIN

</li> <li>At the command prompt, type the following, where Backup_Path is the path of the backup file, and then press ENTER:

stsadm -o backup -url http://companyweb -filename

For example, if you type stsadm -o backup -url http://companyweb -filename c:\backup.dat, you will back up http://companyweb to the Backup.dat file. This file is located in the root directory of drive C.

Note This command backs up the http://companyweb top-level Web site and its subwebs only. If you have additional top-level Web sites, you must use Stsadm.exe to back up each top-level site.</li> <li>Type exit, and then press ENTER.</li></ol> </li> <li>To restore a Windows SharePoint Services 2.0 http://companyweb database by using Stsadm.exe, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Click Start, and then click Run.</li> <li>In the Open: box, type cmd, and then click OK.</li> <li>At the command prompt, type the following and then press ENTER:

cd %programfiles%\Common Files\Microsoft Shared\web server extensions\60\BIN

</li> <li>At the command prompt, type the following, where Backup_Path is the path of the backup file, and then press ENTER:

stsadm -o restore -url http://companyweb -filename  -overwrite

For example, if you type stsadm -o restore -url http://companyweb -filename c:\backup.dat -overwrite, you will restore http://companyweb from the Backup.dat file. This file is located in the root directory of drive C.</li> <li>Type exit, and then press ENTER.</li></ol> </li></ol>

Example script to create daily backups of the http://companyweb database
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. The following example script uses a numbered value for the day of the week. The script then appends this number to the name of the backup file that the script creates in the X:\Backups location. To use this script, copy the following code to a Notepad file, and then customize the text string that specifies the backup file (x:\backups\companyweb). Next, save the Notepad file by using the file name Wssback.vbs, and then create a scheduled task to run this script daily. dim dayweek dim strBackup dayweek = datepart(&quot;w&quot;,(date)) strBackup = &quot;&quot;&quot;C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\stsadm&quot;&quot;&quot; + _ &quot;-o backup -url http://companyweb -filename x:\backups\companyweb&quot; + cstr(dayweek) + &quot;.dat -overwrite&quot; Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;) Return = WshShell.Run(strBackup, 0, true) Set WshShell = Nothing To add this script as a scheduled task, follow these steps:
 * 1) Open Control Panel.
 * 2) Double-click Scheduled Tasks.
 * 3) On the File menu in Scheduled Tasks, point to New, and then click Scheduled Task.
 * 4) Type a name for the scheduled task, such as Companyweb Backup.
 * 5) Double-click the new task to open the task properties.
 * 6) In the Run box, type cscript  :\Wssback.vbs.

Note In this step,  is the location of the Wssback.vbs file.
 * 1) Click Set password, type the password for the user account that the task will use in the Password box and in the Confirm password box, and then click OK.
 * 2) Click the Schedule tab, configure the appropriate schedule, and then click OK.
 * 3) To test the scheduled task, right-click the task, and then click Run. After the task runs, visit the location that you specified for the backup file to verify that the script created the file.

<div class="references_section">