You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/backup-azure-sql-restore-cli.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
title: Restore SQL server databases in Azure VMs using Azure Backup via CLI
3
3
description: Learn how to use CLI to restore SQL server databases in Azure VMs in the Recovery Services vault.
4
4
ms.topic: how-to
5
-
ms.date: 08/11/2022
5
+
ms.date: 07/18/2023
6
6
ms.service: backup
7
7
ms.custom: devx-track-azurecli
8
-
author: jyothisuri
9
-
ms.author: jsuri
8
+
author: AbhishekMallick-MS
9
+
ms.author: v-abhmallick
10
10
---
11
11
12
12
# Restore SQL databases in an Azure VM using Azure CLI
@@ -364,6 +364,38 @@ The response provides you the job name. You can use this job name to track the j
364
364
> [!NOTE]
365
365
> If you don't want to restore the entire chain but only a subset of files, follow the steps as documented [here](restore-sql-database-azure-vm.md#partial-restore-as-files).
366
366
367
+
## Cross Subscription Restore
368
+
369
+
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
370
+
371
+
>[!Note]
372
+
>- You can trigger Cross Subscription Restore from Recovery Services vault.
373
+
>- CSR is supported only for streaming based backup and is not supported for snapshot-based backup.
374
+
>- Cross Regional Restore (CRR) with CSR is not supported.
375
+
376
+
377
+
```azurecli
378
+
az backup vault create
379
+
380
+
```
381
+
382
+
Add the parameter `cross-subscription-restore-state`` that enables you to set the CSR state of the vault during vault creation and updating.
383
+
384
+
```azurecli
385
+
az backup recoveryconfig show
386
+
387
+
```
388
+
389
+
Add the parameter `--target-subscription-id`` that enables you to provide the target subscription as the input while triggering Cross Subscription Restore for SQL or HANA datasources.
Copy file name to clipboardExpand all lines: articles/backup/restore-sql-database-azure-vm.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Azure Backup can restore SQL Server databases that are running on Azure VMs as f
28
28
Before you restore a database, note the following:
29
29
30
30
- You can restore the database to an instance of a SQL Server in the same Azure region.
31
-
- The destination server must be registered to the same vault as the source. If you want to restore backups to a different vault, enable **Cross Subscription Restore**.
31
+
- The destination server must be registered to the same vault as the source. If you want to restore backups to a different vault, [enable Cross Subscription Restore](#cross-subscription-restore).
32
32
- If you have multiple instances running on a server, all the instances should be up and running. Otherwise the server won't appear in the list of destination servers for you to restore the database to. For more information, refer to [the troubleshooting steps](backup-sql-server-azure-troubleshoot.md#faulty-instance-in-a-vm-with-multiple-sql-server-instances).
33
33
- To restore a TDE-encrypted database to another SQL Server, you need to first [restore the certificate to the destination server](/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server).
34
34
-[CDC](/sql/relational-databases/track-changes/enable-and-disable-change-data-capture-sql-server) enabled databases should be restored using the [Restore as files](#restore-as-files) option.
@@ -203,7 +203,7 @@ To restore the database files to the *original path on the source server*, remov
203
203
```
204
204
205
205
>[!Note]
206
-
>You shouldn’t have the same database files on the target server (restore with replace). Also, you can [enable instant file initialization on the target server to reduce the file initialization time overhead](/sql/relational-databases/databases/database-instant-file-initialization?view=sql-server-ver16).
206
+
>You shouldn’t have the same database files on the target server (restore with replace). Also, you can [enable instant file initialization on the target server to reduce the file initialization time overhead](/sql/relational-databases/databases/database-instant-file-initialization?view=sql-server-ver16&preserve-view=true).
207
207
208
208
To relocate the database files from the target restore server, you can frame a TSQL command using the `MOVE` clauses.
209
209
@@ -220,7 +220,7 @@ To relocate the database files from the target restore server, you can frame a T
220
220
GO
221
221
```
222
222
223
-
If there are more than two files for the database, you can add additional `MOVE` clauses to the restore query. You can also use SSMS for database recovery using `.bak` files. [Learn more](/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms?view=sql-server-ver16).
223
+
If there are more than two files for the database, you can add additional `MOVE` clauses to the restore query. You can also use SSMS for database recovery using `.bak` files. [Learn more](/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms?view=sql-server-ver16&preserve-view=true).
224
224
225
225
>[!Note]
226
226
>For large database recovery, we recommend you to use TSQL statements. If you want to relocate the specific database files, see the list of database files in the JSON format created during the **Restore as Files** operation.
@@ -267,6 +267,32 @@ The secondary region restore user experience will be similar to the primary regi
267
267
268
268
:::image type="content" source="./media/backup-azure-sql-database/backup-center-jobs-inline.png" alt-text="Screenshot showing the filtered Backup jobs." lightbox="./media/backup-azure-sql-database/backup-center-jobs-expanded.png":::
269
269
270
+
271
+
272
+
## Cross Subscription Restore
273
+
274
+
Azure Backup now allows you to restore SQL database to any subscription (as per the following Azure RBAC requirements) from the restore point. By default, Azure Backup restores to the same subscription where the restore points are available.
275
+
276
+
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
277
+
278
+
>[!Note]
279
+
>- You can trigger Cross Subscription Restore from Recovery Services vault.
280
+
>- CSR is supported only for streaming based backup and is not supported for snapshot-based backup.
281
+
>- Cross Regional Restore (CRR) with CSR is not supported.
| Restore database or restore as files |`Virtual Machine Contributor`| Source VM that got backed up | Instead of a built-in role, you can consider a custom role which has the following permissions: <br><br> - `Microsoft.Compute/virtualMachines/write` <br> - `Microsoft.Compute/virtualMachines/read`|
288
+
||`Virtual Machine Contributor`| Target VM in which the database will be restored or files are created. | Instead of a built-in role, you can consider a custom role that has the following permissions: <br><br> - `Microsoft.Compute/virtualMachines/write` <br> - `Microsoft.Compute/virtualMachines/read`|
By default, CSR is enabled on the Recovery Services vault. To update the Recovery Services vault restore settings, go to **Properties** > **Cross Subscription Restore** and make the required changes.
292
+
293
+
:::image type="content" source="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png" alt-text="Screenshot shows how to modify the Cross Subscription Restore settings on a Recovery Services vault for SQL database." lightbox="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png":::
294
+
295
+
270
296
## Next steps
271
297
272
298
[Manage and monitor](manage-monitor-sql-database-backup.md) SQL Server databases that are backed up by Azure Backup.
Copy file name to clipboardExpand all lines: articles/backup/sap-hana-database-restore.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,14 +358,14 @@ The secondary region restore user experience is similar to the primary region re
358
358
359
359
## Cross Subscription Restore
360
360
361
-
Azure Backup now allows you to restore SAP HANA Database to any subscription (using the Azure RBAC capabilities) from the restore point. By default, Azure Backup restores to the same subscription where the restore points are available.
361
+
Azure Backup now allows you to restore SAP HANA Database to any subscription (as per the following Azure RBAC requirements) from the restore point. By default, Azure Backup restores to the same subscription where the restore points are available.
362
362
363
363
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
364
364
365
365
>[!Note]
366
366
>- You can trigger Cross Subscription Restore from Recovery Services vault.
367
-
>- CSR is supported only for streaming/Backint-based backups and is not supported for snapshot-based backup.
368
-
Cross Regional Restore (CRR) with CSR is not supported.
367
+
>- CSR is supported only for streaming/Backint-based backups and is not supported for snapshot-based backup.
368
+
>- Cross Regional Restore (CRR) with CSR is not supported.
369
369
370
370
**Azure RBAC requirements**
371
371
@@ -377,9 +377,9 @@ Cross Regional Restore (CRR) with CSR is not supported.
377
377
378
378
By default, CSR is enabled on the Recovery Services vault. To update the Recovery Services vault restore settings, go to **Properties**>**Cross Subscription Restore** and make the required changes.
379
379
380
-
:::image type="content" source="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-hana.png" alt-text="Screenshot shows how to modify the Cross Subscription Restore settings on a Recovery Services vault for HANA database." lightbox="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-hana.png":::
380
+
:::image type="content" source="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png" alt-text="Screenshot shows how to modify the Cross Subscription Restore settings on a Recovery Services vault for HANA database." lightbox="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png":::
Copy file name to clipboardExpand all lines: articles/backup/tutorial-sap-hana-backup-cli.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.author: jsuri
11
11
12
12
# Tutorial: Back up SAP HANA databases in an Azure VM using Azure CLI
13
13
14
-
This tutorial describes how to back up SAP HANA database instance and SAP HANA System Replication (HSR) instance (preview) using Azure CLI.
14
+
This tutorial describes how to back up SAP HANA database instance and SAP HANA System Replication (HSR) instance using Azure CLI.
15
15
16
16
Azure CLI is used to create and manage Azure resources from the Command Line or through scripts. This documentation details how to back up an SAP HANA database and trigger on-demand backups - all using Azure CLI. You can also perform these steps using the [Azure portal](./backup-azure-sap-hana-database.md).
17
17
@@ -64,7 +64,7 @@ Location Name ResourceGroup
64
64
westus2 saphanaVault saphanaResourceGroup
65
65
```
66
66
67
-
# [HSR (preview)](#tab/hsr)
67
+
# [HSR](#tab/hsr)
68
68
69
69
To create the Recovery Services vault for HSR instance protection, run the following command:
70
70
@@ -113,7 +113,7 @@ To register and protect database instance, follow these steps:
113
113
> The column “name” in the above output refers to the container name. This container name will be used in the next sections to enable backups and trigger them. Which in this case, is *VMAppContainer;Compute;saphanaResourceGroup;saphanaVM*.
114
114
115
115
116
-
# [HSR (preview)](#tab/hsr)
116
+
# [HSR](#tab/hsr)
117
117
118
118
To register and protect database instance, follow these steps:
119
119
@@ -217,7 +217,7 @@ To get container name, run the following command. [Learn about this CLI command]
217
217
218
218
```
219
219
220
-
# [HSR (preview)](#tab/hsr)
220
+
# [HSR](#tab/hsr)
221
221
222
222
To enable database instance backup, follow these steps:
223
223
@@ -292,7 +292,7 @@ The response will give you the job name. This job name can be used to track the
292
292
>[!NOTE]
293
293
>Log backups are automatically triggered and managed by SAP HANA internally.
294
294
295
-
# [HSR (preview)](#tab/hsr)
295
+
# [HSR](#tab/hsr)
296
296
297
297
To run an on-demand backup, run the following command:
Copy file name to clipboardExpand all lines: articles/backup/tutorial-sap-hana-restore-cli.md
+37-6Lines changed: 37 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
title: Tutorial - SAP HANA DB restore on Azure using CLI
3
3
description: In this tutorial, learn how to restore SAP HANA databases running on an Azure VM from an Azure Backup Recovery Services vault using Azure CLI.
4
4
ms.topic: tutorial
5
-
ms.date: 06/20/2023
5
+
ms.date: 07/18/2023
6
6
ms.custom: devx-track-azurecli
7
7
ms.service: backup
8
-
author: jyothisuri
9
-
ms.author: jsuri
8
+
author: AbhishekMallick-MS
9
+
ms.author: v-abhmallick
10
10
---
11
11
12
12
# Tutorial: Restore SAP HANA databases in an Azure VM using Azure CLI
13
13
14
-
This tutorial describes how to restore SAP HANA database instance and SAP HANA System Replication (HSR) instance (preview) using Azure CLI.
14
+
This tutorial describes how to restore SAP HANA database instance and SAP HANA System Replication (HSR) instance using Azure CLI.
15
15
16
16
Azure CLI is used to create and manage Azure resources from the command line or through scripts. This documentation details how to restore a backed-up SAP HANA database on an Azure VM - using Azure CLI. You can also perform these steps using the [Azure portal](./sap-hana-db-restore.md).
As you can see, the list above contains three recovery points: one each for full, differential, and log backup.
63
63
64
-
# [HSR (preview)](#tab/hsr)
64
+
# [HSR](#tab/hsr)
65
65
66
66
To view the available recovery points, run the following command:
67
67
@@ -167,7 +167,7 @@ Name Resource
167
167
168
168
The response will give you the job name. This job name can be used to track the job status using [az backup job show](/cli/azure/backup/job#az-backup-job-show) cmdlet.
169
169
170
-
# [HSR (preview)](#tab/hsr)
170
+
# [HSR](#tab/hsr)
171
171
172
172
To start the restore operation, run the following command:
173
173
@@ -502,6 +502,37 @@ Move these restored files to the SAP HANA server where you want to restore them
502
502
* `<LogFilesDir>` - the folder that contains the log backups, differential and incremental backups (if any)
503
503
* `<BackupIdFromJsonFile>` - the **BackupId** extracted in **Step 3**
504
504
505
+
## Cross Subscription Restore
506
+
507
+
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
508
+
509
+
>[!Note]
510
+
>- You can trigger Cross Subscription Restore from Recovery Services vault.
511
+
>- CSR is supported only for streaming/Backint-based backups and is not supported for snapshot-based backup.
512
+
>- Cross Regional Restore (CRR) with CSR is not supported.
513
+
514
+
```azurecli
515
+
az backup vault create
516
+
517
+
```
518
+
519
+
Add the parameter `cross-subscription-restore-state`` that enables you to set the CSR state of the vault during vault creation and updating.
520
+
521
+
```azurecli
522
+
az backup recoveryconfig show
523
+
524
+
```
525
+
526
+
Add the parameter `--target-subscription-id`` that enables you to provide the target subscription as the input while triggering Cross Subscription Restore for SQL or HANA datasources.
* To learn how to manage SAP HANA databases that are backed up using Azure CLI, continue to the tutorial [Manage an SAP HANA database in Azure VM using CLI](tutorial-sap-hana-backup-cli.md)
0 commit comments