Showing posts with label backup and restore. Show all posts
Showing posts with label backup and restore. Show all posts

Wednesday, January 19, 2011

How to Ensure a Full Farm Recovery

SharePoint 2010 stores more configuration information in the content databases than SharePoint 2007, but you still need to be concerned with the following non-SharePoint components to ensure a successful farm recovery:

SharePoint Root

The \Program Files\Common Files\Microsoft Shared\Web server Extensions\14 folder often holds any customizations that your developers have made to your SharePoint implementation. These can include custom graphics, style sheets, and site definitions, to name a few possible modifications. It is important to back up the SharePoint Root on at least one of your Web front-end servers to ensure that these customizations can be recovered. Because the SharePoint Root should be identical on all Web front-end servers, it is not necessary to back up each one separately – makes a lot more easier.

Inetpub folder

This is another location that can be used to store customizations such as graphics and custom Web Parts. You also want to ensure that you have a copy of the Web.config file, because this contains any safe control entries required by custom or third-party Web Parts. Each Web application has a corresponding Inetpub folder on your Web front-end servers, so back up all!

System Binaries

In the event of server failure, you need to recover it to the state it was in before the failure. This can be done either by reinstalling all the system files, patches, service packs, and upgrades that were installed on the server, or by restoring your system files from backup. Often, backup utilities offer a disaster recovery option designed to recover your system to the exact state before the failure.

IIS Settings

SharePoint relies on Web sites hosted by Microsoft Internet Information Server (IIS) to provide access to SharePoint information. It is therefore important that you have a backup of the IIS configurations for the SharePoint servers in the farm. You can do this by opening the IIS Management console from Administrative Tools on the Start menu, right-clicking the server object, selecting All Tasks >  Backup/Restore Configuration option.

To back up the IIS configuration information, use the AppCmd.exe command found in %WinDir%\System32\Inetsrv as shown here.

appcmd.exe add backup "Your Backup Name"

To restore that backup, run the command shown here.

appcmd.exe restore backup "Your Backup Name"

SSL Certificates

You should always keep a backup of your SSL certificates, including the private key. Although this can be retrieved from a system state operating system backup, you must restore the entire system state to access the certificate store that was backed up using Certificate Manager. A configuration backup should always include the use of a password so that the restore is portable and not restricted to the original Web server.

System State Data

System state data includes the following items, which can be backed up by most disaster-recovery software as part of a normal system backup.

  • Start-up files
  • Registry
  • COM+ class registration database
  • IIS configuration
  • Active Directory
  • SYSVOL folder
  • DNS
  • Certificate store

DNS Records

If your DNS server is hosted on a domain controller, the system state data will include the DNS information. If DNS is hosted on a member server or stand-alone server, however, you must back up the Zonename.dns file located at C:\Windows\System32\DNS.

SharePoint 2010 Disaster Recovery Tools

SharePoint 2010 provides several tools to assist in backing up and restoring your SharePoint content, and you will use a combination of them for complete protection. Test each tool available to you within your environment and see what combination of tools works best with your disaster recovery plan.

The following tools and provides information on how and when to use them:

Versioning

This functionality is disabled by default, but after enabling it, you can restore a previous version of a document from within that library as shown in figure below.

VersionHistory

Versioning does not protect content; it only preserves history by creating copies of content each time it is saved. If a document is deleted, it must be recovered from the Recycle Bin.

Two-stage Recycle Bin

SharePoint 2010 includes a two-stage, first-in/first-out Recycle Bin that allows for a second level of retention before content is permanently deleted from the system. By default, after a user deletes an item and then empties their user-level Recycle Bin, the items are retained in the second stage Recycle Bin for 30 days.

Site collection administrators have access to a global view of the Recycle Bin (see figure below) that includes items deleted by all of the end users and allows the administrator to recover items that have been deleted by other users without affecting the value in the Modified By column.

RecycleBin

Central Administration

SharePoint 2010 Central Administration Backup And Restore interface gives you the ability to perform several types of backups and restores, including:

  • Entire farm
  • Farm configuration only
  • Service applications
  • Web applications
  • Content databases
  • Site collections
  • Sites
  • Lists and libraries
Windows PowerShell

SharePoint 2010 Management Shell provides you with a more flexible and dynamic way to perform backups and restores of your SharePoint information. For more information on STSADM commands, see SharePoint 2010 Backup and Restore using Powershell.

STSADM

The STSADM command-line utility also provides functionality to perform backups of the same components as Windows PowerShell does. For more information on STSADM commands, see SharePoint 2010 Farm Backup and Restore using STSADM.

SQL Server

You can also have SharePoint information backed up by your SQL Server administrators or backup operators from within SQL Server. Similar to performing SharePoint backups, SQL Server backups can be performed using a graphical user interface called SQL Server Management Studio.

Read-only content databases

SharePoint 2010 introduces the capability of recognizing content databases that have been set to read-only in SQL Server. This can be helpful during a disaster recovery to prevent changes from being made to the content during the recovery. The procedure to set the database to read-only can be performed using either SQL Server Management Studio or a T-SQL ALTER DATABASE statement.

Unattached content databases

SharePoint 2010 introduces the capability to access databases that are available in SQL Server but aren’t currently part of the farm. This allows you to perform granular restores of SharePoint content using SharePoint. Accessing unattached content databases will allow SharePoint administrators to connect to read-only content databases, restored SharePoint content databases, and content database snapshots. You are able to restore site collections, sites, libraries, and lists from these unattached content databases.

Tuesday, January 18, 2011

SharePoint STSADM Backup and Restore Commands

The following are examples of different STSADM commands you can use to back up and restore various components of your SharePoint environment.

A full farm backup followed by a restore:

stsadm -o backup -url http://app01/ -directory \\app01\sharepointbackups -BackupMethod Full -Quiet
stsadm -o restore -url http://app01/ -filename \\app01\sharepointbackups –Overwrite

Back up and restore configuration information only:

stsadm -o backup -url http://app01 -directory \\app01\sharepointbackups -configurationonly -quiet
stsadm -o restore -url http://app01 -filename \\app01\sharepointbackups -configurationonly –quiet

Back up and restore a service application:

stsadm -o backup -directory \\app01\sharepointbackups -quiet -backupmethod full -item "Excel Services"
stsadm -o restore -directory \\app01\sharepointbackups -item "Excel Services" –quiet

Back up and restore a site collection:

stsadm -o backup -url http://app01/portalsitecollection -filename \\app01\SharePointBackups\portalsitecollection.bak -overwrite
stsadm -o restore -url http://app01/portalsitecollection -filename \\app01\SharePointBackups\portalsitecollection.bak –overwrite

Export and import a subsite, list, or library:

stsadm -o export –url http://app01/sites/contosoportal/Shared%20documents –filename \\app01\sharepointbackups\SD.bak -quiet -overwrite
stsadm -o import –url http://app01/sites/contosoportal/Shared%20documents –filename \\app01\sharepointbackups\SD.bak -quiet

See also example of performing a SharePoint 2010 Backup and Restore using Powershell.

Monday, January 17, 2011

SharePoint PowerShell Backup and Restore Commands

The following are examples of different SharePoint PowerShell commands you can use to back up and restore various components of your SharePoint environment.

A complete farm backup followed by a restore:

Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New

Back up and restore a service application:

Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full –Item "Excel Services"
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New –Item "Excel Services"

Back up and restore farm configuration information only:

Backup-SPConfigurationDatabase –Directory \\App01\SharePointBackups
Restore-SPFarm –Directory \\App01\SharePointBackups –RestoreMethod Overwrite –ConfigurationOnly

Back up and restore your SharePoint content databases:

Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full –Item ContosoPortal
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New –Item ContosoPortal

Back up and restore a site collection:

Backup-SPSite –Identity http://App01/Sites/ContosoPortal -Path \\App01\SharePointBackups\PortalSiteCollection.bak -Force
Restore-SPSite –Identity http://App01/Sites/ContosoPortal -Path \\App01\SharePointBackups\PortalSiteCollection.bak –Force

Export and import a subsite, list, or library:

Export-SPWeb –Identity http://App01/Sites/ContosoPortal/ -Path \\App01\SharePointBackups\SharedDocuments.bak -Itemurl "Shared Documents" -Force
Import-SPWeb –Identity http://App01/Sites/ContosoPortal/ -Path \\App01\SharePointBackups\SharedDocuments.bak –Force -IncludeUserSecurity

See also example of performing a SharePoint 2010 Farm Backup and Restore using STSADM.