backup and Restore for disaster Recovery SharePoint 2010 provides new and improved tools and capabilities to protect its content, configura-tion, and customizations, including extending
Trang 1FIguRE 12-12
This section provided the basic information required to understand the methods to both successfully protect and recover content from corruption, accidental deletion, or other loss scenarios If your organization has service-level agreements targeted specifically at content recovery scenarios, you should evaluate all of the options presented here; and through planning and practice, combine these strategies with your overall business continuity requirements, while keeping in mind that although content comprises the majority of information accessed in SharePoint, its protection alone does not provide an adequate disaster-recovery or high-availability solution Testing is imperative to help you make an informed decision about which solution or combination of solutions should be implemented
to protect your content
dISAStER REcOvERY
Disaster recovery is the process and procedures related to preparing for recovery or continuation
of technology infrastructure in the event that the primary site where that infrastructure is provided
Trang 2is lost due to natural disaster or some other event, making that site unavailable to continue serving users Disaster recovery processes and procedures are commonly guided by two principles:
Recovery point objective (RPO)
➤
continu-ity solution and is impacted by factors such as restore duration from backup and replication performance
Recovery time objective (RTO)
➤
required to bring the service back online It should be mapped to any operating-level agreements established with ancillary technologies, such as Directory Services or network infrastructure, as these services will commonly need to be available before you can offer your service to users
It is equally important to understand that any reduction in RPO and RTO objectives will often increase the costs associated with the technologies elected to provide the business continuity man-agement solution This section describes several solutions available in SharePoint 2010 to facilitate a business continuity management solution
The first step when planning the business continuity management solution is understanding what needs to be recovered in the event of a disaster, keeping in mind that in most cases content comprises
a deployment (see also “Content Recovery” in this chapter) Content is the foundation for most ser-vice applications and should be prioritized in most solutions — for example, prioritizing the recovery
of Search over content provides no value, as Search requires content to crawl to effectively provide value to users
An additional consideration that applies in continuity management solutions is the protection of customizations deployed to a server farm environment Some of these customizations can be pro-tected adequately using the functionality provided by SharePoint 2010, but in some cases you will need to catalog, manually protect, or replicate these customizations in the destination server farm environment
backup and Restore for disaster Recovery
SharePoint 2010 provides new and improved tools and capabilities to protect its content, configura-tion, and customizations, including extending options that were previously available only through the command line to the user interface, new features to provide greater granularity, and overall improvements in performance and resiliency In SharePoint 2010, backup and restore capabilities are distributed across two primary areas of functionality:
Farm backup and restore
➤
➤
Granular backup
➤
➤
Farm backup and restore, also known as catastrophic backup and restore, provides solutions designed
to enable you to backup and restore components of a server farm or the entire server farm environ-ment, in addition to providing entry points that enable you to configure backup settings and access backup and restore history
Trang 3In addition to an entire server farm, backup enables you to protect the following components: Confi guration databases
➤
➤
Web applications, to include settings and content databases
➤
➤
Service applications, to include settings and databases where present
➤
➤
Services such as InfoPath Forms, State, Application Registry, and User Code Solution services
➤
➤
Granular Backup provides solutions designed to enable you to back up site collections, export sites and lists, recover data from unattached content databases, and access backup history
In addition to the features provided through SharePoint 2010 Central Administration,
SharePoint 2010 continues to provide backup and restore capabilities through both the SharePoint Administration Tool and new capabilities through Windows PowerShell
While the SharePoint Administration Tool is still available under
%commonprogramfiles%\Microsoft Shared\Web Server Extensions\14\
command-line administrative tasks The SharePoint Administration Tool has
been deprecated, but it is included to support compatibility with previous
product versions.
backing up and Restoring content databases
We have already demonstrated that there are many tools in SharePoint 2010 that you can use to accomplish a task You have the option of using Windows PowerShell, the Central Administration website, or even STSADM, if you must Backing up content databases is no different In this section
we cover the different ways you can back up your content databases in SharePoint 2010
Backing Up and restoring Content Databases Using Central administration
SharePoint 2010 provides improved backup and restore functionality out of the box, including greater granularity, improved monitoring and reporting, and greater scale and effi ciency With SharePoint 2010 backup and restore, you can back up one or more content databases in either full or differential mode
To back up a content database using SharePoint 2010 Backup and Restore:
1 Open SharePoint 2010 Central Administration and select Perform a backup under Farm Backup and Restore
2 On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, expand the web application where the content database to be backed up is attached and select the content database you want to back up If you want to back up multiple content databases you can only do that by backing up the entire web application You can’t back up content databases in different web applications without backing up the whole farm Select the content databases or web applications you want to backup and click Next
Trang 43 On the Start Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select Full
4 In the Backup File Location section, type the Universal Naming Convention (UNC) path of the backup folder, and then click Start Backup
Figure 12-13 shows how the fi nal screen will look before the backup is run
FIguRE 12-13
To perform a differential backup instead of a full backup, simply select Differential
instead of Full as the Backup Type in step 3 of these instructions For more
discus-sion about choosing between full and differential backups, see the “Backing Up
and Restoring Content Databases Using Microsoft SQL Server” section coming
up shortly.
Trang 5Remember that you can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in the Readiness section, and see the status for the current backup job in the lower part of the page in the Backup section
To restore a content database using SharePoint 2010 Backup and Restore:
1 Open SharePoint 2010 Central Administration and select Farm Backup and Restore ➪ Restore from a backup
2 On the Restore from Backup - Step 1 of 3: Select Backup to Restore page, specify the Universal Naming Convention (UNC) path of the backup folder if not already populated and click Refresh
3 Select the backup to be restored from the list of available backups and then click Next
4 On the Restore from Backup - Step 2 of 3: Select Component to Restore page, select the com-ponent to be restored from the list of available comcom-ponents and then click Next
5 On the Restore from Backup - Step 3 of 3: Select Restore Options page, select the type of restore to perform in the Restore Options section
Two options are available, New and Same Confi guration:
a New Confi guration enables an administrator to restore to a farm with a separate
com-puter name, web application settings, or database server If you select New, specify the new naming information in the provided fi elds
b Selecting Same Confi guration will overwrite any existing copy of the data.
In some cases, the desired content databases may not be refl ected in the Central
Administration user interface If the content database is not selectable, you
must use Windows PowerShell or SQL Server tools to restore it.
Backing Up and restoring Content Databases Using Windows Powershell
New Windows PowerShell support enables you to perform common administrative tasks, apply varying levels of backup, and restore granularity
To back up a content database by using Windows PowerShell, enter the following command in the Microsoft SharePoint 2010 Management Shell:
Backup-SPFarm -Directory <Backup folder> -BackupMethod {Full | Differential} -Item <Content database name> [-Verbose]
To restore a content database by using Windows PowerShell, use the following command:
Restore-SPFarm -Directory <Backup folder name> -RestoreMethod Overwrite -Item
<Content database name> [-BackupId <GUID>] [-Verbose]
Trang 6For content databases that have not been previously backed up, you must use
the -Full switch.
Backing Up and restoring Content Databases Using Microsoft sQl server
SQL Server provides the greatest scale and selection of backup options available to SharePoint 2010 content databases, including Full, Differential, and Incremental
Depending on your specifi c recovery point and recovery time objectives, you may often be required
to combine these options to provide the broadest overall coverage and facilitate rapid recovery of content For example, many enterprises are expected to provide a 21-day, disk-based backup regi-men; in this scenario, a combination of three full and 18 differential backups are implemented to meet the requirements and minimize the storage footprint
SQL Server provides a number of options and levels of granularity for performing database back-ups Full backup is the simplest form of backup with SQL Server; it provides database administra-tors with additional options such as the capability to perform single data fi le or fi legroup backups SharePoint 2010 does not support partitioning schemes, which are required to fully support multiple
fi legroups, so these options are not discussed here; however, while SharePoint 2010 supports mul-tiple data fi les, all data fi les should be backed up and restored as a single unit when working with SharePoint 2010 content databases
A full database backup provides a complete copy of the content database and provides a “point in time” snapshot to which the database can be restored; however, it does not include the time during which the backup was running This is important to understand in order to meet specifi c recov-ery point objectives, due to the increased backup duration that occurs as the size of the database increases
Full database backups are the easiest to use and contain all of the data in the content database When working with a small content database of 50GB or less, the usual best practice is to rely on just full database backups However, as noted earlier, as the size of a database increases, so does the duration of the backup; and therefore it takes more time to fi nish and requires more storage space
In these cases, the best practice is to supplement full backups with differential backups, in order to ensure effi ciency and performance in both backup and restore
To perform a full database backup of an individual SharePoint 2010 content database:
1 Open Microsoft SQL Server Management Studio and connect to the appropriate instance of the Microsoft SQL Server Database Engine
2 In Object Explorer, click the server name to expand the server tree
3 Expand Databases, and select a content database from the list of available user databases
4 Right-click the desired content database, and select Tasks ➪ Back Up, as shown in
Figure 12-14
Trang 7FIguRE 12-14
5 On the Back Up Database dialog, verify the database name in the Database list box
6 In the Backup type list box, select Full from the list of available options
7 For Backup component, click Database
8 Either accept the default backup set name prepopulated in the Name text box or enter a dif-ferent name for the backup set
9 In large environments, provide a description of the content database in the Description text box The description can include the database name, host web application, etc., to help data-base administrators easily identify the content datadata-base
10 Choose the type of backup destination by clicking Disk If a filename is not already popu-lated, click Add to add one Figure 12-15 shows the database being backed up to C:\
Backups\WSS_Content.bak
11 SQL Server 2008 Enterprise and later support backup compression By default, whether a backup is compressed depends on the value of the backup-compression default server con-figuration option However, regardless of the current server-level default, you can compress a backup by checking Compress backup, or you can prevent compression by checking Do not compress backup
Trang 8FIguRE 12-15
To restore a content database backed up through SQL Server:
1 Open Microsoft SQL Server Management Studio and connect to the appropriate instance of the Microsoft SQL Server Database Engine
2 In Object Explorer, click the server name to expand the server tree
3 In most disaster recovery instances you need to keep
the production database online, but you need to
recover an older instance to get content out To do
that you will restore the database with a different
name Right click on Databases and select Restore
Database… as shown in Figure 12-16
4 In the To database box type the name you want the
restored database to have Normally this is the
data-base’s original name with the date of the backup
appended
5 Click From device and use the ellipses to choose the database backup file you created in the preceding backup steps
FIguRE 12-16
Trang 96 When the list of backup sets populates be sure to click the checkbox next to the one you want to restore, even if there is only one Figure 12-17 shows how it should look
7 Click OK, and if things go well you will get a happy dialog box telling you the restore com-pleted successfully Congratulations!
FIguRE 12-17
If you prefer to restore over the top of an existing database you can do that too
In step 3, right-click on the database you want to restore over and select Tasks ➪
Restore ➪ Database Then follow the same steps to restore your database.
Database snapshots
SharePoint 2010 also introduces support for database snapshots (to learn more about snapshots, see
“SQL Server Snapshots,” earlier in this chapter)
Snapshots are a little tough to set up, and defi nitely not for the faint of heart In this section you take
a look at how to set them up, then walk through the steps Figure 12-18 shows the before and after
Trang 10FIguRE 12-18
The query in the query window is the command that was used to create the snapshot There is no way in the UI to do it The fi rst line creates the snapshot as a database named WSS_Content_Snap The arrow points to where you will fi nd it in the interface after it has been created The next line, Name=WSS_Content, refers to the Logical name of the database fi le for the database you are making the snapshot of In most cases it will be the same as the database name itself, as is the case here The next line specifi es the name of the fi le that will contain the snapshot, WSS_Content_Snap.ss The
fi nal line specifi es which database this will be a snapshot of That’s all there is to it Once you get the query written, press the Execute button in the menu bar, sit back, and let the magic happen Once you have the snapshot created you can treat it like any read-only database You can mount it in SharePoint and render out the content, or you can use it to do an unattached database restore When you’re fi nished with the snapshot you can delete it the same way you would a regular database
Backing up content databases to snapshots is only available through the SQL
Server management tools When using snapshots, you should understand their
limitations and requirements For more information on this subject, see the
library/ms189940.aspx.