How to Backup and Restore Companyweb in Small Business Server 2008
[Today’s post comes to us courtesy of Kunal Ghotge, Gagan Mehra, David Copeland, Justin Crosby, and Shawn Sullivan from Commercial Technical Support]
In this post, we will discuss options to backup and restore your SharePoint (Companyweb) site. A good backup and restore strategy is essential for maintaining business continuity when disaster happens.
Available Tools for backup
Tools |
User Interface |
Backup Type |
Windows SharePoint Services: STSADM.exe |
Command Line |
Full and Differential |
Windows SBS 2008 Backup |
Graphical |
Full and Incremental |
Windows SharePoint Services: Central Administration |
Graphical |
Full and Differential |
STSADM
STSADM is a utility that is installed with SharePoint that allows you to perform administrative tasks on your SharePoint sites. By default, it is located in the following path: %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\12\BIN.
Note: You must run these commands from an elevated command prompt.
Backup Process
STSADM –o backup –url <SharePoint url> –filename <backup target file location> –overwrite
For example:
STSADM –o backup –url https://companyweb –filename “D:\backup\companyweb.bak” –overwrite
Restore Process
STSADM –o restore –url <SharePoint url> –filename <backup source file location> -overwrite
For example:
STSADM –o restore –url https://companyweb –filename “D:\backup\companyweb.bak” –overwrite
For more information on STSADM commands, see:
https://technet.microsoft.com/en-us/library/cc288981.aspx
Using STSADM with Task Scheduler
Now that we have shown you how to backup SharePoint (Companyweb) using STADM, here is how to schedule those backups so that you always have an up to date backup.
Create a script with the following content and save it as a .VBS file:
dim dayweek
dim strBackup
dayweek = datepart("w",(date))
strBackup = """C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm""" + "-o backup -url https://companyweb -filename x:\backups\companyweb" + cstr(dayweek) + ".dat -overwrite"
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run(strBackup, 0, true)Set WshShell = Nothing
Important: Substitute x:\backups\companyweb for your desired backup location. You must create this directory before running the scheduled task or it will fail.Launch the Task Scheduler
- Start –> Administrative Tools –>Task Scheduler.
- Click on Create Task in the Action Pane.
Enter a name for the new task and choose Run whether user is logged on or not.
Click on Actions tab and click on New.. . then ensure the following settings.
Action: Start a Program
Program/Script: CScript
Arguments: Location of the script file which was saved earlierClick on Triggers tab and click New to define your backup schedule.
Click OK.
When it prompts for the password, provide your Administrator credentials.
Note: Make sure that the Administrator account that will run the task has the “Log on as batch job” user right. This can be done using the Group Policy settings. Additionally, when the password for the Administrator account changes in Active Directory, you must update the task with the new password.
Using Windows SBS 2008 Backup
You can also use Windows Small Business Server 2008 backup to backup and restore SharePoint (Companyweb). For information on how to configure Small Business Server 2008 backup to backup your server and SharePoint on a schedule, see: https://blogs.technet.com/sbs/archive/2008/11/03/introducing-sbs-2008-backup.aspx
Backup Now
Once SBS backup has been configured using the above link you will have the ability to create a backup immediately without having to wait for the schedule. To do this:
Open the SBS Console and choose the Backup and Server Storage pane.
Click on Backup now and click OK on the popup that appears.
You will be notified once the backup is complete
Restoring Companyweb
Open the SBS Console and choose the Backup and Server Storage pane
Click the Restore server data from backup task
Select the option to restore This server (Servername) and click Next.
Select the date and time of the backup job you wish to restore and click Next.
Under Select recovery type, choose Applications and click Next.
Select Windows SharePoint Services. You can confirm the details by clicking on View Details. This will show you the files that will be restored.
Choose the option to Recover to original location and click Next.
Confirm the selected options and click Recover.
Once the restore finishes you will see a summary screen.
You can also use the SharePoint Central Administration site for backup and restore. However, we recommend using the above methods on Small Business Server 2008. For more information on the use of the SharePoint Central Administration site for backup and restore, please visit the following link: https://technet.microsoft.com/en-us/library/cc288396.aspx