Edit

Share via


Export-SRConfiguration

Exports replication configuration to a Windows PowerShell script.

Syntax

Default (Default)

Export-SRConfiguration
    [[-ComputerName] <String>]
    [-Path] <String>
    [-Seeded]
    [-AllowClobber]
    [<CommonParameters>]

Description

The Export-SRConfiguration cmdlet exports the replication configuration for a computer to a Windows PowerShell .ps1 configuration script. You can use this .ps1 file as a configuration backup to reapply in event that Storage Replica settings are damaged or removed. You can also use this file to migrate settings to another computer.

Examples

Example 1: Export configuration

This command exports all replication partnership and group information to a Windows PowerShell script named sr-srv01.ps1 in the C:\temp folder.
PS C:\>Export-SRConfiguration -Path "C:\temp\sr-srv01.ps1"
Exported 1 Storage Replica partnerships.
Exported 2 Storage Replica groups.

This command displays the contents of the script by using the Get-Content cmdlet.
PS C:\>Get-Content -Path "C:\temp\sr-srv01.ps1"
New-SRGroup -Computer SR-SRV01 -Name ReplicationGroup01 -VolumeName D:\ -LogVolumeName e:\ -LogSizeInBytes 8589934592
New-SRGroup -Computer SR-SRV03 -Name ReplicationGroup02 -VolumeName D:\ -LogVolumeName e:\ -LogSizeInBytes 8589934592
New-SRPartnership -SourceComputerName SR-SRV01 -SourceRGName ReplicationGroup01 -DestinationComputerName SR-SRV03 -DestinationRGName Rep
licationGroup02 -ReplicationMode Synchronous -PreventReplication
Write-Host Please execute Sync-SRGroup to resume replication.

Parameters

-AllowClobber

Indicates that the cmdlet overwrites an existing file. By default, this cmdlet does not overwrite an existing file.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AC

Parameter sets

(All)
Position:99
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputerName

Specifies a single replica host computer NetBIOS name or fully qualified domain name (FQDN) for which this cmdlet exports configuration. The default value is the local computer.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:CN

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Path

Specifies the path of the exported configuration file, including the file name. By default, this cmdlet does not overwrite an existing file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:P

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Seeded

Specifies that the destination computer contains a seeded copy of the data from the source server. Seeded data is a copy of data from the source server, such as a restored backup or copies of drives. Unused blocks also count toward seeding. This option may reduce bandwidth usage during initial replication and is likely to use more CPU and memory.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:S

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.