Redigera

Dela via


Copy-AzRecoveryServicesVault

Copies data from a vault in one region to a vault in another region.

Syntax

Copy-AzRecoveryServicesVault
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-SourceVault] <ARSVault>
    [-TargetVault] <ARSVault>
    [-RetryOnlyFailed]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Copy-AzRecoveryServicesVault
    [-Force]
    -CorrelationIdForDataMove <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-SourceVault] <ARSVault>
    [-TargetVault] <ARSVault>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Copy-AzRecoveryServicesVault cmdlet copies data from a vault in one region to a vault in another region. Currently we only support vault level data move.

Examples

Example 1: Copy data from vault1 to vault2

$sourceVault = Get-AzRecoveryServicesVault -ResourceGroupName "rgName1" -Name "vault1"
$targetVault = Get-AzRecoveryServicesVault -ResourceGroupName "rgName2" -Name "vault2"
Copy-AzRecoveryServicesVault -SourceVault $sourceVault -TargetVault $targetVault

The first two cmdlets fetch Recovery Services Vault - vault1 and vault2 respectively. The second command triggers a complete data move from vault1 to vault2. $sourceVault and $targetVault can also belong to different subscription within same tanent, can be fetched by setting different subscription contexts.

Example 2: Copy data from vault1 to vault2 with only failed items

$sourceVault = Get-AzRecoveryServicesVault -ResourceGroupName "rgName1" -Name "vault1"
$targetVault = Get-AzRecoveryServicesVault -ResourceGroupName "rgName2" -Name "vault2"
Copy-AzRecoveryServicesVault -SourceVault $sourceVault -TargetVault $targetVault -RetryOnlyFailed

The first two cmdlets fetch Recovery Services Vault - vault1 and vault2 respectively. The second command triggers a partial data move from vault1 to vault2 with only those items which failed in previous move operations. $sourceVault and $targetVault can also belong to different subscription within same tanent, can be fetched by setting different subscription contexts.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CorrelationIdForDataMove

Correlation Id for triggering DS Move.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the data move operation (prevents confirmation dialog) without asking confirmation for target vault storage redundancy type. This parameter is optional.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RetryOnlyFailed

Switch parameter to try data move only for containers in the source vault which are not yet moved.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SourceVault

The source vault object to be moved.

Type:ARSVault
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TargetVault

The target vault object where the data has to be moved.

Type:ARSVault
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ARSVault

Outputs

String