Migrate storage resources to global Azure
Important
Since August 2018, we have not been accepting new customers or deploying any new features and services into the original Microsoft Cloud Germany locations.
Based on the evolution in customers’ needs, we recently launched two new datacenter regions in Germany, offering customer data residency, full connectivity to Microsoft’s global cloud network, as well as market competitive pricing.
Additionally, on Sept 30th, 2020, we announced that the Microsoft Cloud Germany would be closing on October 29th, 2021. More details are available here: https://www.microsoft.com/cloud-platform/germany-cloud-regions.
Take advantage of the breadth of functionality, enterprise-grade security, and comprehensive features available in our new German datacenter regions by migrating today.
This article has information that can help you migrate Azure storage resources from Azure Germany to global Azure.
Note
We recommend that you use the Azure Az PowerShell module to interact with Azure. See Install Azure PowerShell to get started. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.
Blobs
AzCopy is a free tool you can use to copy blobs, files, and tables. AzCopy works for Azure-to-Azure, on-premises-to-Azure, and Azure-to-on-premises migrations. Use AzCopy for your migration to copy blobs directly from Azure Germany to global Azure.
If you don't use managed disks for your source VM, use AzCopy to copy the .vhd files to the target environment. Otherwise, you must complete some steps in advance. For more information, see Recommendations for managed disks.
The following example shows how AzCopy works. For a complete reference, see the AzCopy documentation.
AzCopy uses the terms Source and Dest, expressed as URIs. URIs for Azure Germany always have this format:
https://<storageaccountname>.blob.core.cloudapi.de/<containername>/<blobname>
URIs for global Azure always have this format:
https://<storageaccountname>.blob.core.windows.net/<containername>/<blobname>
You get the three parts of the URI (storageaccountname, containername, blobname) from the portal, by using PowerShell, or by using the Azure CLI. The name of the blob can be part of the URI or it can be given as a pattern, like vm121314.vhd.
You also need the storage account keys to access the Azure Storage account. Get them from the portal, by using PowerShell, or by using the CLI. For example:
Get-AzStorageAccountKey -Name <saname> -ResourceGroupName <rgname>
As always, you need only one of the two keys for each storage account.
Example:
URI part | example value |
---|---|
Source storageAccount | migratetest |
Source container | vhds |
Source blob | vm-121314.vhd |
Target storageAccount | migratetarget |
Target container | targetcontainer |
This command copies a virtual hard disk from Azure Germany to global Azure (keys are shortened to improve readability):
azcopy -v /source:https://migratetest.blob.core.cloudapi.de/vhds /sourcekey:"0LN...w==" /dest:https://migratetarget.blob.core.windows.net/targetcontainer /DestKey:"o//ucDi5TN...w==" /Pattern:vm-121314.vhd
To get a consistent copy of the VHD, shut down the VM before you copy the VHD. Plan some downtime for the copy activity. When the VHD is copied, rebuild your VM in the target environment.
For more information:
- Review the AzCopy documentation.
- Learn how to create a VM from restored disks.
Managed Disks
Azure Managed Disks simplifies disk management for Azure infrastructure as a service (IaaS) VMs by managing the storage accounts that are associated with the VM disk.
Because you don't have direct access to the .vhd file, you can't directly use tools like AzCopy to copy your files (see Blobs). The workaround is to first export the managed disk by getting a temporary shared access signature URI, and then download it or copy it by using this information. The following sections show an example of how to get the shared access signature URI and what to do with it.
Step 1: Get the shared access signature URI
- In the portal, search for your managed disk. (It's in the same resource group as your VM. The resource type is Disk.)
- On the Overview page, select the Export button in the top menu (you have to shut down and deallocate your VM first, or unattach the VM).
- Define a time for the URI to expire (the default is 3,600 seconds).
- Generate a URL (this step should take only a few seconds).
- Copy the URL (it appears only once).
Step 2: AzCopy
For examples of how to use AzCopy, see Blobs. Use AzCopy (or a similar tool) to copy the disk directly from your source environment to the target environment. In AzCopy, you have to split the URI into the base URI and the shared access signature part. The shared access signature part of the URI begins with the character "?". The portal provides this URI for the shared access signature URI:
https://md-kp4qvrzhj4j5.blob.core.cloudapi.de/r0pmw4z3vk1g/abcd?sv=2017-04-17&sr=b&si=22970153-4c56-47c0-8cbb-156a24b6e4b5&sig=5Hfu0qMw9rkZf6mCjuCE4VMV6W3IR8FXQSY1viji9bg%3D>
The following commands show the source parameters for AzCopy:
/source:"https://md-kp4qvrzhj4j5.blob.core.cloudapi.de/r0pmw4z3vk1g/abcd"
/sourceSAS:" ?sv=2017-04-17&sr=b&si=22970153-4c56-47c0-8cbb-156a24b6e4b5&sig=5Hfu0qMw9rkZf6mCjuCE4VMV6W3IR8FXQSY1viji9bg%3D"
Here's the complete command:
azcopy -v /source:"https://md-kp4qvrzhj4j5.blob.core.cloudapi.de/r0pmw4z3vk1g/abcd" /sourceSAS:"?sv=2017-04-17&sr=b&si=22970153-4c56-47c0-8cbb-156a24b6e4b5&sig=5Hfu0qMw9rkZf6mCjuCE4VMV6W3IR8FXQSY1viji9bg%3D" /dest:"https://migratetarget.blob.core.windows.net/targetcontainer/newdisk.vhd" /DestKey:"o//ucD... Kdpw=="
Step 3: Create a new managed disk in the target environment
You have several options for creating a new managed disk. Here's how to do it in the Azure portal:
- In the portal, select New > Managed Disk > Create.
- Enter a name for the new disk.
- Select a resource group.
- Under Source type, select Storage blob. Then, either copy the destination URI from the AzCopy command or browse to select the destination URI.
- If you copied an OS disk, select the OS type. For other disk types, select Create.
Step 4: Create the VM
As noted earlier, there are multiple ways to create a VM by using this new managed disk. Here are two options:
- In the portal, select the disk, and then select Create VM. Define the other parameters of your VM as usual.
- For PowerShell, see Create a VM from restored disks.
For more information:
- Learn how to export to disk via API by getting a shared access signature URI.
- Learn how to create a managed disk via API from an unmanaged blob.
Tables
You can migrate tables in Azure using Storage Explorer. Storage Explorer is a tool to manage your Azure cloud storage resources. Using Storage Explorer, you can connect to the source Germany storage account and copy tables to the target Azure global storage account.
To begin, install Azure Storage Explorer.
Connect to source
You use Storage Explorer to copy tables from the source Azure Storage account.
Connect Storage Explorer to the your source table resources in Microsoft Azure Germany. You can sign in to access resources in your subscription or you can attach to specific Storage resources.
Connect to target
You use Storage Explorer to paste tables to the target Azure Storage account.
Connect Storage Explorer to your target Microsoft Azure subscription or Azure Storage. You can sign in to access resources in your subscription or you can attach to specific Storage resources.
Migrate tables
Copy tables from Azure Germany to an Azure global using Storage Explorer. You can copy tables by right clicking the table you want to copy and choosing Copy table from the shortcut menu. The following example shows copying the testmigrationtable from an Azure Germany subscription.
Paste the table into the target Azure Storage account using Storage Explorer. You can past tables by right clicking the Tables node within the target Azure Storage account. The following example shows pasting the testmigrationtable to a connected Azure Storage account.
Repeat the copy and paste steps for each table you want to migrate.
File shares
Use AzCopy for your migration to copy file shares directly from Azure Germany to global Azure. AzCopy is a free tool you can use to copy blobs, files, and tables.
To begin, download AzCopy and install.
AzCopy uses the terms Source and Dest, expressed as URIs. URIs for Azure Germany always have this format:
https://<storageaccountname>.blob.core.cloudapi.de/<filesharename>
URIs for global Azure always have this format:
https://<storageaccountname>.blob.core.windows.net/<filesharename>
You need a storage account SAS token to access the Azure Storage account.
The following example command copies all file shares, directories, and files from an Azure Germany storage account to a global Azure storage account. For a complete reference, see the AzCopy documentation.
URI part | Example value |
---|---|
Source storageAccount | migratetest |
Source file share | sourcefileshare |
Target storageAccount | migratetarget |
Target fileshare | targetfileshare |
azcopy copy "https://migratetest.blob.core.cloudapi.de/sourcefileshare?<SAS-token>" "https://migratetarget.blob.core.windows.net/targetfileshare?<SAS-token>" --recursive=true
For more information about AzCopy, see the AzCopy documentation and Transfer data with AzCopy and file storage.
Next steps
Learn about tools, techniques, and recommendations for migrating resources in the following service categories: