- Implementing a Backup Strategy
- Implementing a Restore Strategy
A. Implementing a Backup Strategy
A. 1. Backing Up Sharepoint Using Central Administration
A. 1. 1. Create a backup share- Log on to SP2010-WFE1 as Contoso\SP_Admin with password.
- Open Windows Explorer and then browse to the C Drive.
- In the toolbar, click New Folder
- Type SharepointBackup, and then press ENTER.
- Right-click SharepointBackup, and then click Properties
- Click the Security tab
- Click Edit
- In the Group or user names list, select Users.
- Select the Allow check box next to Full Control
- Click OK
- Click the Sharing tab
- Click Advanced Sharing
- Select the Share this folder check box
- Click Permissions
- Select Allow check box next to Full Control
- Click OK
- Click OK
- Click Close.
- Open Sharepoint 2010 Central Administration. The User Account Control dialog box appears.
- Click Yes.
- In the Quick Launch, click Backup and Restore.
- In the Farm Backup and Restore section, click Perform a Backup. The Perform a Backup - Step 1 02 2: Select Component to Back Up page opens.
- Observe the components that can be backed up.
- Farm
- Various solutions and services
- Microsoft Office InfoPath Forms Services
- Sharepoint Server State Service
- Microsoft Sharepoint Foundation Web Application(s)
- WSS_Administration
- Sharepoint Server State Service Proxy
- SPUserCodeV4
- Global Search Settings
- Application Registry Service
- Shared Services
- Select the Sharepoint - intranet.contoso.com80 check box.
- Click Next. The Perform a Backup - Step 2 of 2: Select Backup Options page opens.
- In the Backup Type section, click Full.
- In the Backup location box, type \\SP2010-WFE1.contoso.com\SharepointBackup
- Click Start Backup
Refresh the page - Wait until Phase shows as Completed.
A. 3. 1. Examine the backup folder
- Switch to Windows Explorer, and then open the C:\SharepointBackup folder.
- Right-click Spbrtoc.xml, and then click Edit.
- Examine the file, which is similar to the following:
<?xml version="1.0" encodin="utf-8"?>
<SPBackupREstoreHistory>
<SPHistoryObject>
<SPId>GUID of operation/SPId> <SPRequestedBy>CONTOSO\SP_Admin</SPRequestedBy>
<SPBackupMethod>Full</SPBackupMethod>
<SPRestoreMethod>None</SPRestoreMethod>
<SPStartTime>Start Date and time</SPStartTime>
<SPFinishTime>End Date and time</SPFinishTime>
<SPIsBackup>True</SPIsBackup>
<SPConfigurationOnly>False</SPConfigurationOnly>
<SPBackupDirectory>\\SP2010-WFE1,contoso.com\SharepointBackup\
spbr0000\</SPBackupDirectory>
<SPDirectoryName>spbr0000</SPDirectoryName>
<SPDirectoryNumber>0 </SPDirectoryNumber>
<SPTopComponent>Farm\Microsoft Sharepoint Foundation Web Application\
Sharepoint - intranet.contoso.com80</SPTopComponent>
<SPTopComponentId>GUID of top component</SPTopComponentId>
<SPWarningCount>1</SPWarningCount>
<SPErrorCount>0</SPErrorCount>
</SPHistoryObject>
</SPBackupRestoreHistory> - Locate the SPHistoryObject element.
This element describes the backup operation, and is used during a restore operation. - Locate the SPBackupDirectory element.
This element is a reference to the folder in which the backup files are stored. - Locate the SPWarningCount and SPErrorCount elements.
These elements report warnings and errors. - Close Microsoft notepad.
- In Windows Explorer, open the spbr000 folder.
- Observer the backuup (*.bak) files in the folder.
- Right-click Spbackup.xml, and then click Edit.
- Examine the Spbackup.xml, and then click Edit. This file contains attributes related to the backup operation and to each of the components. It is used during a restore operation. You should not modify, delete, or rename the Spbackup.xml file.
- Close Notepad.
- Double-click spbackup.log.
- Examine the log. Observe that each of the backup operations is listed, including the T-SQL commands that were sent to Microsoft SQL Server.
- Press CTRL+END to navigate to the end of the log.
- Observe that last lines of the log, which indicate that the backup completed and summarizes the number of warnings and errors.
- Press CTRL+Home to navigate to the top of the log.
- Press CTRL+F, type Warning, and then press ENTER.
- Write down the warning message
- Press CTRL+Home to navigate to the top of the log.
- Press CTRL+F , then type BACKUP DATABASE and then press ENTER.
- Observe the command that was sent to SQL Server to back up on of the Sharepoint databases.
- Press F3 to find the next instance of the text, "Backup Database," Repeat this step as necessary to locate the backup command that was used to back up the WSS_Content_Intranet_IT database.
- Close Notepage.
A. 4. 1. Create a backup script
- Open Windows Explorer and then browse to the C drive.
- In the toolbar, click New Folder.
- Type Scripts, and then press ENTER.
- Open Notepad.
- Type the following text:
Add-PSSnapin Microsoft.Sharepoint.Powershell
Backup-SPFarm -directory \\SP2010-WFE1.contoso.com\SharepointBackup -backupmethod full - Click File, and then click Save.
- In the File name box, type C:\scripts\backup.ps1, and then press ENTER
- Minimize, but do not close Notepad.
- Click Start, point to Administrative Tools, and then click Task Scheduler.
- In the Actions panel, click Create Basic Task.
- On the Create Basic Task page, in the Name box, type Backup Sharepoint - Full
- In the Description box, type Back up the Sharepoint farm
- Click Next
- On the Trigger page, click Daily
- Click Next
- On the Daily page, configure the Start time to 1:00AM
- Click Next.
- On the Action page, click Start a program.
- Click Next
- On the Start a Program page, in the Program/script box, type Powrshell.exe
- In the Add arguments (optional) box, type C:\Scripts\backup.ps1
- Click Next
- On the Summary page, select the Open the Properties dialog for this task when I click Finish check box.
- Click Finish
- Click Change User or Group.
- Type CONTOSO\SP_Farm and then click OK
- On the General tab, in the Security options section, click Run whether user is logged on or not
- Select the Run with highest privileges check box.
- Click OK.
- In the Password box, type its password.
- Click OK.
- In the console tree, click Task Scheduler Library
- Right-click Backup Sharepoint - Full, and then click Run.
- Open the C:\SharepointBackup folder.
- Observe that a new backup folder, spbr0001 is created.
- Switch to Sharepoint 2010 Central Administration
- In the Quick Launch, click Backup and Restore.
- Click Check backup and restore job status.
- Examine the information that is presented on the Backup and Restore Job Status page.
- Click View History
- Examine the information that is presented on the Backup and Restore History page
- Click Backup and Restore Job Status to return to the status page
- Wait for the Phase to be Completed before continuing to the next step.
B. 1. Restoring a Web Application Using Central Administration
B. 1. 1. Delete a Web Application
- Switch to Sharepoint 2010 Central Administration
- In the Quick Launch, click Application Management
- In the Web Applications section, click Manage Web applications
- Select the row, Sharepoint - intranet.contoso.com80
- On the ribbon, click Delete.
- The Delete Web Application page opens.
- In the Delete content database section, click Yes.
- In the Delete IIS Web Sites section, click Yes.
- Click Delete. A confirmation message appears.
- Click OK. The Web application is deleted.
- Open Internet Explorer.
- In the address bar, type http://intranet.contoso.com, and then press ENTER. An error page opens.
- Switch to Sharepoint 2010 Central Administration.
- In the Quick Launch, click Backup and Restore.
- In the Farm Backup and Restore section, click Restore from a backup.
The Restore from backup - Step 1 of 3 page opens. - Select the radio button next to Farm in the first (oldest) backup.
- Click Next. The Restore from backup - Step 3 of 3 page opens.
- Select the check box next to Sharepoint - intranet.contoso.com80.
- Click Next.
- In the Restore Options box, click Same configuration.
- Click OK.
- In the Login Names and Passwords section, in the Password box, type its password.
- Click Start Restore. A timer job is created to perform the restore of the selected item(s).
- Wait until Phase shows as Completed
- Switch to the instance of Internet Explorer that displays the error page from step B.1.2.
- In the address bar, type http://intranet.contoso.com and then press ENTER.
B. 2. 1. Examine the backup folder
- Open the C:\sharepointbackup folder.
- Right-click Spbrtoc.xml and then click Edit.
- Examine the file, and identify the SPHistoryObject element that describes the restore operation.
- Locate the SPRestoreMethod element. This element describes the type of restore operation that was performed.
- Locate the SPBackupDirectory element.
- Locate the SPTopComponent element.
- Locate the SPWarningCount & SPErrorCount elements.
- Close Notepage
- In Windows Explorer, open the spbr001 folder.
- Right-click Sprestore.xml, and then click Edit.
- Examine the Sprestore.xml file. This file contains attributes related to the restore operation and to each of the components. You should not modify, delete, or rename the sprestore.xml file.
- Close Notepad.
- Double-click Sprestore.log.
- Press CTRL+END to navigate to the end of the log.
- Observe the last lines of the log, which indicate that the backup completed and summarizes the number of warnings and errors.
- Press CTRL+HOME to navigate to the top of the log.
- Press CTRL+F, then type Progress: Starting Restore, and then press ENTER.
- In the Find dialog box, in the Find what box, type Warnings, and then press ENTER.
- Write down the warning message
- Press CTRL+HOME to navigate to the top of the log.
- Press CTRL+F, then type Restore Database , and then press ENTER.
- Observe the command that was sent to SQL Server to restore one of the Sharepoint databases.
- Close Notepad.
B. 3. 1. Restore a content database