|
2 | 2 | title: Move Azure VMs to new subscription or resource group
|
3 | 3 | description: Use Azure Resource Manager to move virtual machines to a new resource group or subscription.
|
4 | 4 | ms.topic: conceptual
|
5 |
| -ms.date: 01/24/2022 |
| 5 | +ms.date: 02/28/2022 |
6 | 6 | ms.custom: devx-track-azurepowershell, devx-track-azurecli
|
7 | 7 | ---
|
8 | 8 |
|
@@ -110,21 +110,35 @@ If [soft delete](../../../backup/soft-delete-virtual-machines.md) is enabled for
|
110 | 110 | 1. Temporarily stop the backup and keep backup data.
|
111 | 111 | 2. To move virtual machines configured with Azure Backup, do the following steps:
|
112 | 112 |
|
113 |
| - 1. Find the location of your virtual machine. |
114 |
| - 2. Find a resource group with the following naming pattern: `AzureBackupRG_<VM location>_1`. For example, the name is in the format of *AzureBackupRG_westus2_1*. |
115 |
| - 3. In the Azure portal, check **Show hidden types**. |
116 |
| - 4. Find the resource with type **Microsoft.Compute/restorePointCollections** that has the naming pattern `AzureBackup_<VM name>_###########`. |
117 |
| - 5. Delete this resource. This operation deletes only the instant recovery points, not the backed-up data in the vault. |
118 |
| - 6. After the delete operation is complete, you can move your virtual machine. |
| 113 | + 1. Find the resource group that contains your backups. If you used the default resource group, it has the following naming pattern: `AzureBackupRG_<VM location>_1`. For example, the name is in the format of *AzureBackupRG_westus2_1*. |
| 114 | + |
| 115 | + If you created a custom resource group, select that resource group. If you can't find the resource group, search for **Restore Point Collections** in the portal. Look for the collection with the naming pattern `AzureBackup_<VM name>_###########`. |
| 116 | + 1. Select the resource with type **Restore Point Collection** that has the naming pattern `AzureBackup_<VM name>_###########`. |
| 117 | + 1. Delete this resource. This operation deletes only the instant recovery points, not the backed-up data in the vault. |
| 118 | + 1. After the delete operation is complete, you can move your virtual machine. |
119 | 119 |
|
120 | 120 | 3. Move the VM to the target resource group.
|
121 | 121 | 4. Reconfigure the backup.
|
122 | 122 |
|
123 | 123 | ### Script
|
124 | 124 |
|
125 |
| -1. Find the location of your virtual machine. |
| 125 | +1. Find the resource group that contains your backups. If you used the default resource group, it has the following naming pattern: `AzureBackupRG_<VM location>_1`. For example, the name is in the format of *AzureBackupRG_westus2_1*. |
126 | 126 |
|
127 |
| -1. Find a resource group with the naming pattern - `AzureBackupRG_<VM location>_1`. For example, the name might be `AzureBackupRG_westus2_1`. |
| 127 | + If you created a custom resource group, find that resource group. If you can't find the resource group, use the following command and provide the name of the virtual machine. |
| 128 | +
|
| 129 | + # [Azure CLI](#tab/azure-cli) |
| 130 | +
|
| 131 | + ```azurecli-interactive |
| 132 | + az resource list --resource-type Microsoft.Compute/restorePointCollections --query "[?starts_with(name, 'AzureBackup_<vm-name>')].resourceGroup" |
| 133 | + ``` |
| 134 | +
|
| 135 | + # [PowerShell](#tab/azure-powershell) |
| 136 | +
|
| 137 | + ```azurepowershell-interactive |
| 138 | + (Get-AzResource -ResourceType Microsoft.Compute/restorePointCollections -Name AzureBackup_<vm-name>*).ResourceGroupName |
| 139 | + ``` |
| 140 | +
|
| 141 | + --- |
128 | 142 |
|
129 | 143 | 1. If you're moving only one virtual machine, get the restore point collection for that virtual machine.
|
130 | 144 |
|
|
0 commit comments