Copy-AzSqlDatabaseLongTermRetentionBackup
Copies a long term retention backup to a target database.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Copy-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ServerName] <String>
[-DatabaseName] <String>
[-BackupName] <String>
[-ResourceGroupName <String>]
-TargetDatabaseName <String>
[-TargetServerFullyQualifiedDomainName <String>]
[-TargetServerName <String>]
-TargetSubscriptionId <String>
-TargetResourceGroupName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Copy-AzSqlDatabaseLongTermRetentionBackup
[-ResourceId] <String>
-TargetDatabaseName <String>
[-TargetServerFullyQualifiedDomainName <String>]
[-TargetServerName <String>]
-TargetSubscriptionId <String>
-TargetResourceGroupName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Copy-AzSqlDatabaseLongTermRetentionBackup
[-InputObject] <AzureSqlDatabaseLongTermRetentionBackupModel>
-TargetDatabaseName <String>
[-TargetServerFullyQualifiedDomainName <String>]
[-TargetServerName <String>]
-TargetSubscriptionId <String>
-TargetResourceGroupName <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Copies a long term retention backup to a target database. Target database may be in different cluster than backup source.
Examples
Example 1: Copy a long term retention backup to another server within the same environment.
PS C:\> Copy-AzSqlDatabaseLongTermRetentionBackup -Location southeastasia -ServerName test-server -DatabaseName test-database -BackupName 'e5c20f43-494c-4925-89d1-58e0f4569fb3;132579992320000000' -ResourceGroupName testrg -TargetDatabaseName ltr1 -TargetServerName ayang-eas -TargetSubscriptionId '01c4ec88-e179-44f7-9eb0-e9719a5087ab' -TargetResourceGroupName testrg
SourceResourceGroupName : test-rg
SourceLocation : southeastasia
SourceServerName : test-server
SourceDatabaseName : test-database
SourceBackupName : e5c20f43-494c-4925-89d1-58e0f4569fb3;132579992320000000
SourceBackupResourceId : /subscriptions/01c4ec88-e179-44f7-9eb0-e9719a5087ab/resourceGroups/test-rg/providers/Microsoft.Sql/locations/SoutheastAsia/longTermRetentionServers/test-server/longTermRetentionDatabases/test-database/longTermRetentionBackups/e5c20f43-494c-4925-89d1-58e0f4569fb3;132579992320000000
SourceBackupStorageRedundancy : Geo
TargetSubscriptionId : 01c4ec88-e179-44f7-9eb0-e9719a5087ab
TargetResourceGroupName : test-rg
TargetLocation : East Asia
TargetServerName : ayang-eas
TargetServerFullyQualifiedDomainName :
TargetServerResourceId : /subscriptions/01c4ec88-e179-44f7-9eb0-e9719a5087ab/resourceGroups/test-rg/providers/Microsoft.Sql/servers/ayang-eas
TargetDatabaseName : ltr1
TargetBackupName : 70554a1f-ae6e-479e-99b1-50ea320654eb;132579992320000000
TargetBackupResourceId : /subscriptions/01c4ec88-e179-44f7-9eb0-e9719a5087ab/resourceGroups/test-rg/providers/Microsoft.Sql/locations/East Asia/longTermRetentionServers/ayang-eas/longTermRetentionDatabases/ltr1/longTermRetentionBackups/70554a1f-ae6e-479e-99b1-50ea320654eb;132579992320000000
This copies a long term retention backup from a source database in Southeast Asia to a target database in East Asia.
Parameters
Run cmdlet in the background
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the backup.
| Type: | String |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the Azure SQL Database the backup is from.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Database Long Term Retention Backup object to remove.
| Type: | AzureSqlDatabaseLongTermRetentionBackupModel |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The location of the backups' source server.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the resource group.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Resource ID of the Database Long Term Retention Backup to remove.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The name of the Azure SQL Server the backup is under.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the target database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The resource ID of the target subscription.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The fully qualified domain name of the target server.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the target server.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The resource ID of the target subscription.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
AzureSqlDatabaseLongTermRetentionBackupModel
Outputs
AzureSqlDatabaseLongTermRetentionBackupModel