Wednesday, 22 January 2014

Back up and restore in SharePoint 2013

Back up and restore in SharePoint 2013

Requirements to back up and restore SharePoint 2013

·         Before you back up data, create a shared folder that stores the data. For best performance, create this folder on the database server. If you want to archive the backups to another server, you can copy the whole backup folder to that server after backup is complete. Be sure to copy and move the whole backup folder and not the individual backup folders under this folder.
·         The SQL Server VSS Writer service, which is available with SQL Server 2008 R2and SQL Server 2012 database software, must be started for the SharePoint 2013 VSS Writer service to work correctly. By default, the SharePoint 2013 VSS Writer service is not automatically started.
·         Make sure that the SharePoint Foundation 2013 Administration service is started on all farm servers before you perform a backup. By default, this service is not started on stand-alone installations.
·         Make sure that the user accounts that you want to perform a backup have access to the shared backup folder.
·         If you use Central Administration to back up, the database server's SQL service account, the Timer service account, and the Central Administration application pool identity account must have Full Control permissions to the backup locations.
·         The database server and farm server that you want to back up must be able to connect to one another.
·         If you use SQL Server with Transparent Data Encryption (TDE), and you use either SharePoint tools or SQL Server tools to back up your environment, the TDE encryption key is not backed up or restored. You must manually back up the key. When you restore the environment, you must manually restore the key before you restore the data.


Use Windows PowerShell to back up a farm in SharePoint

You can use Windows PowerShell to back up the farm manually or as part of a script that can be run at scheduled intervals.

To back up a farm by using Windows Power Shell

Verify that you have the following memberships:

o    security admin fixed server role on the SQL Server instance.
o    db_owner fixed database role on all databases that are to be updated.
o    Administrators group on the server on which you are running the Windows Power Shell cmdlets.
An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

Start the SharePoint 2013 Management Shell.

o    For Windows Server 2008 R2:
1.      On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.
o    For Windows Server 2012:
§  On the Start screen, click SharePoint 2013 Management Shell.
If SharePoint 2013 Management Shell is not on the Start screen:
o    Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.
o    For more information about how to interact with Windows Server 2012,

 At the Windows Power Shell command prompt, type the following command:


Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} [-Verbose]

Note: If you are backing up the farm for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup

Use Central Administration to back up a SharePoint farm

To back up a farm by using Central Administration

1.      Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.
2.      In Central Administration, on the home page, in the Backup and Restore section, click Perform a backup.
3.      On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, select the farm from the list of components, and then click Next.
4.      On the Start Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select either Fullor Differential.
5.      In the Back Up Only Configuration Settings section, click Back up content and configuration settings.
6.      In the Backup File Location section, type the UNC path of the backup folder, and then click Start Backup.
7.      You can view the general status of all backup jobs at the top of the Backup and Restore Status page in theReadiness section. You can view the status for the current backup job in the lower part of the page in theBackup section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take several seconds for the backup to start.
If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Spbackup.log file at the UNC path that you specified in step 


 

 

Use SQL Server tools to back up a SharePoint farm

If you want to back up the complete farm, you must use either Windows PowerShell or Central Administration. You cannot back up the complete farm by using the SQL Server tools because you cannot use the tools to back up the farm’s configuration. However, you can back up all the databases that are associated with the farm. The databases that are associated with the farm are determined by the services and features that you have installed on the farm.

To back up the databases associated with a farm by using SQL Server tools

1.      Verify that the user account that is performing this procedure is a member of the SQL Server db_owner fixed database role on all databases that are to be backed up.
2.      Open SQL Server Management Studio and connect to the correct instance of the SQL Server Database Engine.
3.      In Object Explorer, expand Databases.
4.      Right-click the database that you want to back up, point to Tasks, and then click Back Up.
5.      In the Back Up Database dialog box, in the Source area, select the kind of backup that you want to perform from the Backup type list. For more information about which backup type to use, see Recovery Models (SQL Server).
6.      In the Backup component area, click Database.
7.      Either use the default name that is provided or specify a name for the backup set in the Name text box.
8.      Specify the expiration date for the backup set. This date determines how long, or when, the backup set can be overwritten by any later backups that have the same name. By default, the backup set is set to never expire (0 days).
9.      In the Destination area, specify where you want to store the backup.
10.  Click OK to back up the database.
11.  Repeat steps 1-10 for each farm database.


Use Windows PowerShell to back up a SharePoint farm configuration

You can use Windows PowerShell to back up the configuration from any configuration database on the current farm, on another farm, or from a configuration database that is not associated with any farm. You can back up a farm configuration manually or as part of a script that can be run at scheduled intervals.

To back up the configuration from any configuration database by using Windows PowerShell

1.      Verify that you have the following memberships:
o    securityadmin fixed server role on the SQL Server instance.
o    db_owner fixed database role on all databases that are to be updated.
o    Administrators group on the server on which you are running the Windows PowerShell cmdlets.
An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 Products cmdlets.
2.      Start the SharePoint 2013 Management Shell.
o    For Windows Server 2008 R2:
§  On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then clickSharePoint 2013 Management Shell.
o    For Windows Server 2012:
§  On the Start screen, click SharePoint 2013 Management Shell.
If SharePoint 2013 Management Shell is not on the Start screen:
§  Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.
For more information about how to interact with Windows Server 2012,
3.     At the Windows PowerShell command prompt, type the following command:

Backup-SPConfigurationDatabase -Directory <BackupFolder> -DatabaseServer <DatabaseServerName> -DatabaseName <DatabaseName> -DatabaseCredentials <WindowsPowerShellCredentialObject> [-Verbose]


Use Central Administration to back up a SharePoint farm configuration

You can use Central Administration to back up the configuration of the farm that Central Administration is running on. To back up the configuration of a remote farm, you must use the Central Administration Web site that is running on the remote farm. You cannot use Central Administration to back up an unattached configuration database.

 

To back up a farm configuration by using Central Administration

1.      Verify that the user account performing this procedure is a member of the Farm Administrators group.
2.      On the Central Administration home page, in the Backup and Restore section, click Perform a backup.
3.      On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, select the farm from the list of components, and then click Next.
4.      On the Start Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select Full.
5.      In the Backup Only Configuration Settings section, select the Backup only configuration settings option.
6.      In the Backup File Location section, type the Universal Naming Convention (UNC) path of the backup folder, and then click Start Backup.
7.      You can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in theReadiness section. You can view the status for the current backup job in the lower part of the page in theBackup section. The status page updates every 30 seconds automatically. You can manually refresh the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take several seconds for the backup to start.
8.      If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Spbackup.log file at the UNC path that you specified in step 5.

Use Windows PowerShell to back up a web application

You can use Windows PowerShell to back up a web application manually or as part of a script that can be run at scheduled intervals.

To back up a web application by using Windows PowerShell

1.      Verify that you have the following memberships:
o    securityadmin fixed server role on the SQL Server instance.
o    db_owner fixed database role on all databases that are to be updated.
o    Administrators group on the server on which you are running the Windows PowerShell cmdlets.
An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 Products cmdlets.
2.     Start the SharePoint 2013 Management Shell.
o    For Windows Server 2008 R2:
§  On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then clickSharePoint 2013 Management Shell.
o    For Windows Server 2012:
§  On the Start screen, click SharePoint 2013 Management Shell.
If SharePoint 2013 Management Shell is not on the Start screen:
§  Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.
For more information about how to interact with Windows Server 2012,
3.      At the Windows PowerShell command prompt, type the following command:

Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} -Item <WebApplicationName> [-Verbose]


Use Central Administration to back up a web application

You can use Central Administration to back up a web application.

To back up a web application by using Central Administration

1.     Verify that the user account that is performing this procedure is a member of the Farm Administrators group.
2.     Start SharePoint 2013 Central Administration.
o    For Windows Server 2008 R2:
§  Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Central Administration.
o    For Windows Server 2012:
§  On the Start screen, click SharePoint 2013 Central Administration.
If SharePoint 2013 Central Administration is not on the Start screen:
§  Right-click Computer, click All apps, and then click SharePoint 2013 Central Administration.
For more information about how to interact with Windows Server 2012,
3.     In Central Administration, on the home page, in the Backup and Restore section, click Perform a backup.
4.     On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, select the web application from the list of components, and then click Next.
5.     On the Start Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select either Fullor Differential.
6.     In the Back Up Only Configuration Settings section, click Back up content and configuration settings.
7.     In the Backup File Location section, type the Universal Naming Convention (UNC) path of the backup folder, and then click Start Backup.
8.     You can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in theReadiness section. You can view the status for the current backup job in the lower part of the page in theBackup section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take several seconds for the backup to start.
If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Spbackup.log file at the UNC path that you specified in step 6.


Only Backup services:


Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} -Item "Farm\Shared Service Applications" [-Verbose]



To back up the User Profile service application by using Windows PowerShell


Backup-SPFarm -Directory <BackupFolder> -BackupMethod Full -Item Farm\Shared Services\Shared Service Applications\<ServiceApplicationName> [-Verbose]

 

 

Use Windows PowerShell to back up search in SharePoint 2013


Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} -Item “<SearchServiceApplicationName>” [-Verbose]

Use Central Administration to back up search in SharePoint 2013

You can use Central Administration to back up search. This procedure backs up all of the search components including the databases, the search service configuration, and all of the index files.

To back up search by using Central Administration

1.     Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.
2.     Start SharePoint 2013 Central Administration.
o    For Windows Server 2008 R2:
§  Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Central Administration.
o    For Windows Server 2012:
§  On the Start screen, click SharePoint 2013 Central Administration.
If SharePoint 2013 Central Administration is not on the Start screen:
§  Right-click Computer, click All apps, and then click SharePoint 2013 Central Administration.
3.     In Central Administration, on the home page, in the Backup and Restore section, click Perform a backup.
4.     On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, in the list of components, expand Shared Services and then expand Shared Services Applications to view the list of service applications in the farm. Select the search service application from the list of components, and then click Next.
5.     On the Start Backup — Step 2 of 2: Select Backup Options page, in the Backup Type section, select either Fullor Differential.
6.     In the Backup File Location section, in the Backup location box, type the path of the backup folder, and then click Start Backup.
7.     You can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in theReadiness section. You can view the status for the current backup job in the lower part of the page in theBackup section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are timer service jobs. Therefore, it might take several seconds for the backup to start.
If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Spbackup.log file at the UNC path that you specified in step 6.


Use Windows PowerShell to back up a content database in SharePoint 2013


To back up a content database by using Windows PowerShell

Backup-SPFarm -Directory   <BackupFolder>  -BackupMethod {Full | Differential} -Item <ContentDatabaseName> [-Verbose]


Use SQL Server tools to back up a database to a snapshot in SharePoint Server

If you want to back up databases to snapshots, you must use SQL Server tools. The databases that are associated with the farm are determined by the service applications and features that you have installed on the farm.

To back up a database to a snapshot by using SQL Server tools

1.     Verify that the user account that is performing this procedure is a member of the SQL Server db_owner fixed database role.
2.     Open SQL Server Management Studio and connect to the database server.
3.     In Object Explorer, expand Databases.
4.     Select the database that you want to back up, and then click New Query.
5.     Copy the following text, and then paste it to the query pane.

CREATE DATABASE <snapshot name>
ON
(
NAME=<logical name of the database file>,
FILENAME = 'c:\WSS_Backup1.ss')
AS SNAPSHOT OF <database name>;


Use Windows PowerShell to back up a site collection in SharePoint 2013

To back up a site collection by using Windows PowerShell

Backup-SPSite -Identity <SiteCollectionGUIDorURL> -Path <BackupFile> [-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose]

 

 

Use Central Administration to back up a site collection in SharePoint 2013

You can use Central Administration to back up a site collection.

To back up a site collection by using Central Administration

1.     Verify that the user account performing this procedure is a member of the Farm Administrators group. Additionally, verify that the Windows SharePoint Services Timer V4 service has Full Control permissions on the backup folder.
2.     Start SharePoint 2013 Central Administration.
o    For Windows Server 2008 R2:
§  Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Central Administration.
o    For Windows Server 2012:
§  On the Start screen, click SharePoint 2013 Central Administration.
If SharePoint 2013 Central Administration is not on the Start screen:
§  Right-click Computer, click All apps, and then click SharePoint 2013 Central Administration.
3.     In Central Administration, on the home page, in the Backup and Restore section, click Perform a site collection backup.
4.     On the Site collection backup page, select the site collection from the Site Collection list.
5.     Type the local path of the backup file in the Filename box.
6.     Click Start Backup.
7.     You can view the general status of all backup jobs at the top of the Granular Backup Job Status page in theReadiness section. You can view the status for the current backup job in the lower part of the page in the Site Collection Backup section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take several seconds for the backup to start.