Export (0) Print
Expand All

Restore-SPFarm

SharePoint 2013
 

Applies to: SharePoint Server 2013 Enterprise, SharePoint Foundation 2013

Topic Last Modified: 2013-12-18

Restores one or more items from a backup.

Restore-SPFarm -Directory <String> -RestoreMethod <String> [-AssignmentCollection <SPAssignmentCollection>] [-BackupId <Guid>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-FarmCredentials <PSCredential>] [-Force <SwitchParameter>] [-Item <String>] [-NewDatabaseServer <String>] [-Percentage <Int32>] [-RestoreThreads <Int32>] [-WhatIf [<SwitchParameter>]]
Restore-SPFarm -Directory <String> -ShowTree <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-BackupId <Guid>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Item <String>] [-WhatIf [<SwitchParameter>]]

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet Parameter Sets.

The Restore-SPFarm cmdlet restores one or more items from a backup such as an individual database, Web application, or the entire farm. This cmdlet can also be used to apply a farm template to the entire farm.

 

Parameter Required Type Description

Directory

Optional

System.String

Specifies the path where SharePoint 2010 Products stored the backup package. If you have a computer on which SQL Server 2008 and an instance of SharePoint 2010 Products are installed, you can use local drive paths. This includes a basic installation. However, if SQL Server 2008 and SharePoint 2010 Products are installed on multiple computers, you must use Universal Naming Convention (UNC) share paths so that the SQL Server 2008 and SharePoint 2010 Products can read from the same location (for example, \\computer_name \volume\Backup).

The type must be either of the valid paths:

- C:\folder_name

- \\server_name\folder_name

NoteNote:
The spbr* folders are created automatically.

RestoreMethod

Optional

System.String

Specifies the method of restore to perform.

The valid values are:

- New; Specifies a new location to restore the content and is intended to be used when restoring to a different farm. Additional prompts will be presented to specify the new settings.

- Overwrite; Restores content and settings to their original locations and is intended to be used when restoring to the same farm it was backed up from. If the Overwrite parameter is used, a confirmation prompt is displayed. If you want the confirmation prompt suppressed, use the Force parameter.

ShowTree

Optional

System.Management.Automation.SwitchParameter

Displays which objects in the farm will be restored based on the other parameters passed to the Restore-SPFarm cmdlet namely the Item and ConfigurationOnly parameters. Items that will be excluded from the restore based on the other parameters passed to the Restore-SPFarm cmdlet will be preceded with an asterisk (*). Items that cannot be restored will be enclosed in square brackets ([ ]). A restore operation will not be performed if the ShowTree parameter is present.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

NoteNote:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

BackupId

Optional

System.Guid

Specifies the GUID of the backup package that is to be restored. Each backup package has a unique GUID associated with it. The GUID can be seen by using the Get-SPBackupHistory cmdlet to view the backup history. If this parameter is not specified, the most recent backup package in the path that is specified with the Directory parameter is used.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890abcdef.

ConfigurationOnly

Optional

System.Management.Automation.SwitchParameter

Specifies settings only (no data) will be restored from the backup package and applied to objects on the destination farm.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

FarmCredentials

Optional

System.Management.Automation.PSCredential

Specifies the credentials that will be used for all components being restored. For example, the application pool credentials for Web applications being restored. If an application pool being restored already exists in the farm, the credentials specified by the FarmCredentials parameter is ignored when restoring that application pool.

Force

Optional

System.Management.Automation.SwitchParameter

Suppresses the prompt warning that you will overwrite components when you perform an overwrite restore operation.

Item

Optional

System.String

Indicates the part of the backup package to be restored. You can use the full farm path notation as displayed by the ShowTree parameter or the name of the target component in the path if it has a unique name. If multiple items match the name, the full path must be provided. Surround the item or path in double quotation marks if it contains a space. If this parameter is absent, the entire backup package is restored.

The type must be a valid item, such as:

Farm\Microsoft SharePoint Foundation Web Application\SharePoint - 80

NewDatabaseServer

Optional

System.String

Specifies a valid SQL Database Server name. If specified, will be used as a default Database Server name for all databases within the restore operation.

This parameter is only valid when restoring as new. It is not valid for overwrite restores.

Percentage

Optional

System.Int32

Requests that progress updates about the restore operation be displayed in increments of that percentage. For example, a value of 5 displays restore progress updates at every 5 percent completed, and a value of 10 displays restore progress updates at every 10 percent completed.

Note: Progress will only be displayed in the output if the -Verbose parameter is specified. Otherwise, you may see the progress in the restore log file.

This percentage is not precise and the actual progress updates might be lower or higher than requested.

For a very large database, 1 is the recommended value.

The type must be an integer value between 1 and 100.

The default value is 5.

RestoreThreads

Optional

System.Int32

The number of threads that should be used during the restore.

The fewer the restore threads, the easier it is to understand the restore log. However, the more restore threads, the more components can be restored in parallel, potentially resulting in a faster restore.

The valid range is between 1 and 10. The default value is 3.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

-------------------EXAMPLE 1-----------------------

Restore-SPFarm -Directory \\file_server\share\Backup -BackupId 12345678-90ab-cdef-1234-567890abcdef -RestoreMethod new -ConfigurationOnly

This example restores the configuration settings from the backup package in the \\file_server\share\Backup directory to the farm.

-------------------EXAMPLE 2-----------------------

Restore-SPFarm -ShowTree -Directory \\file_server\share\Backup -BackupId 12345678-90ab-cdef-1234-567890abcdef -Item "Microsoft SharePoint Foundation Web Application" -Verbose

This example show which components of the farm would be restored under the Microsoft SharePoint Foundation Web Application node, but does not actually restore them.

-------------------EXAMPLE 3-----------------------

Restore-SPFarm -Directory C:\Backup -BackupId 12345678-90ab-cdef-1234-567890abcdef  -RestoreMethod overwrite -RestoreThreads 10 -Force

This example restores a farm by using 10 threads and suppresses the overwrite warning.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft