Frequently Asked Questions About Azure Storage Migration
Frequently Asked Questions About Azure Storage Migration
Storage migration
This article answers common questions about Azure Storage migration.
FAQ
How do I create a script to copy files from one container to another?
To copy files between containers, you can use AzCopy. See the following example:
AzCopy /Source:https://xxx.blob.core.windows.net/xxx
/Dest:https://xxx.blob.core.windows.net/xxx /SourceKey:xxx /DestKey:xxx
/S
AzCopy uses the Copy Blob API to copy each file in the container.
You can use any virtual machine or local machine that has internet access to run AzCopy.
You can also use an Azure Batch schedule to do this automatically, but it's more complicated.
The automation script is designed for Azure Resource Manager deployment instead of
storage content manipulation. For more information, see Deploy resources with Resource
Manager templates and Azure PowerShell.
Is there any charge for copying data between two file shares on the same storage
account within the same region?
There is no option to back up an entire storage account directly. But you can manually move
the container in that storage account to another account by using AzCopy or Storage
Explorer. The following steps show how to use AzCopy to move the container:
1. Install the AzCopy command-line tool. This tool helps you move the VHD file
between storage accounts.
2. After you install AzCopy on Windows by using the installer, open a Command
Prompt window and then browse to the AzCopy installation folder on your computer.
By default, AzCopy is installed to %ProgramFiles(x86)%\Microsoft SDKs\Azure\
AzCopy or %ProgramFiles%\Microsoft SDKs\Azure\AzCopy.
3. Run the following command to move the container. You must replace the text with
the actual values.
3. AzCopy
/Source:https://sourceaccount.blob.core.windows.net/mycontainer1
4. /Dest:https://destaccount.blob.core.windows.net/mycontainer2
5. /SourceKey:key1 /DestKey:key2 /S
6.
o /Source: Provide the URI for the source storage account (up to the container).
o /Dest: Provide the URI for the target storage account (up to the container).
o /SourceKey: Provide the primary key for the source storage account. You can
copy this key from the Azure portal by selecting the storage account.
o /DestKey: Provide the primary key for the target storage account. You can
copy this key from the portal by selecting the storage account.
After you run this command, the container files are moved to the target storage account.
Note
The AzCopy CLI does not work together with the Pattern switch when you copy from one
Azure blob to another.
You can directly copy and edit the AzCopy command, and cross-check to make sure that
Pattern matches the source. Also make sure that /S wildcards are in effect. For more
information, see AzCopy parameters.
How do I create a PowerShell script to move data from one Azure file share to another
in Azure Storage?
Use AzCopy to move the data from one Azure file share to another in Azure Storage. For
more information, see Transfer data with AzCopy on Windows and Transfer data with
AzCopy on Linux.
Use AzCopy to upload large .csv files to Azure Storage. For more information, see Transfer
data with AzCopy on Windows and Transfer data with AzCopy on Linux.
I have to move the logs from drive D to my Azure storage account every day. How do I
automate this?
You can use AzCopy and create a task in Task Scheduler. Upload files to an Azure storage
account by using an AzCopy batch script. For more information, see How to configure and
run startup tasks for a cloud service.
Use AzCopy to move your storage account between subscriptions. For more information, see
Transfer data with AzCopy on Windows and Transfer data with AzCopy on Linux.
How can I move about 10 TB of data to storage at another region?
Use AzCopy to move the data. For more information, see Transfer data with AzCopy on
Windows and Transfer data with AzCopy on Linux.
Use AzCopy to copy the data. For more information, see Transfer data with AzCopy on
Windows and Transfer data with AzCopy on Linux.
Use AzCopy to move data. For more information, see Transfer data with AzCopy on
Windows and Transfer data with AzCopy on Linux.
There is no backup solution. However, Azure Files also supports asynchronous copy. So, you
can copy files:
1. Stop the virtual machine that the managed disk is attached to.
2. Copy the managed disk VHD from one area to another by running the following
Azure PowerShell script:
Connect-AzureRmAccount
3. $resourceGroupName = 'MDDemo'
4.
5. $diskName = 'contoso\_os\_disk1'
6.
7. $vhdUri = 'https://contoso.storageaccou.com.vhd
8.
9. $storageId = '/subscriptions/<ID>/resourceGroups/<RG
name>/providers/Microsoft.Storage/storageAccounts/contosostorageaccou
nt1'
10.
11. $location = 'westus'
12.
13. $storageType = 'StandardLRS'
14.
15. $diskConfig = New-AzureRmDiskConfig -AccountType $storageType -
Location $location -CreateOption Import -SourceUri $vhdUri -
StorageAccountId $storageId -DiskSizeGB 128
16.
17. $osDisk = New-AzureRmDisk -DiskName $diskName -Disk $diskConfig -
ResourceGroupName $resourceGroupName
18.
For more information about how to deploy a virtual machine from a managed disk, see
CreateVmFromManagedOsDisk.ps1.
Use AzCopy to download the data. For more information, see Transfer data with AzCopy on
Windows and Transfer data with AzCopy on Linux.
How do I change the secondary location to the Europe region for a storage account?
When you create a storage account, you select the primary region for the account. The
selection of the secondary region is based on the primary region, and it cannot be changed.
For more information, see Geo-redundant storage (GRS): Cross-regional replication for
Azure Storage.
Where can I get more information about Azure Storage Service Encryption (SSE)?
Use AzCopy to download the data. For more information, see Transfer data with AzCopy on
Windows and Transfer data with AzCopy on Linux.
Use AzCopy to copy the data to a different storage account and then move the data back. You
can also use encryption at rest.
How can I download a VHD to a local machine, other than by using the download
option in the portal?
Are there any prerequisites for changing the replication of a storage account from geo-
redundant storage to locally redundant storage?
No.
1. Create a standard storage account. (Or use an existing standard storage account in
your subscription.)
2. Download AzCopy. Run one of the following AzCopy commands.
AzCopy /Source:https://sourceaccount.blob.core.windows.net/mycontainer1
/Dest:https://destaccount.blob.core.windows.net/mycontainer2
/SourceKey:key1 /DestKey:key2 /S
To copy only one disk, provide the name of the disk in Pattern:
2. AzCopy
/Source:https://sourceaccount.blob.core.windows.net/mycontainer1
3. /Dest:https://destaccount.blob.core.windows.net/mycontainer2
4. /SourceKey:key1 /DestKey:key2 /Pattern:abc.vhd
5.
To make sure that the transfer finished successfully, examine the destination storage account
container in the Azure portal. After the disks are copied to the standard storage account, you
can attach them to the virtual machine as an existing disk. For more information, see How to
attach a managed data disk to a Windows virtual machine in the Azure portal.
How do I convert to Azure Premium Storage for a file share?
You must create the destination storage account, copy data from the source account to the
destination account, and then delete the source account. You can use a tool such as AzCopy
to copy the data.
If you have virtual machines, you must take additional steps before you migrate the storage
account data. For more information, see Migrating to Azure Premium Storage (unmanaged
disks).
How do I move from a classic storage account to an Azure Resource Manager storage
account?
You can use the Move-AzureStorageAccount cmdlet. This cmdlet has multiple steps
(validate, prepare, commit). You can validate the move before you make it.
If you have virtual machines, you must take additional steps before you migrate the storage
account data. For more information, see Migrate IaaS resources from classic to Azure
Resource Manager by using Azure PowerShell.
If you access AzCopy from the Microsoft Azure Storage command line, type
AzCopy. The command line is installed alongside AzCopy.
If you installed the 32-bit version, it's located here: %ProgramFiles(x86)%\
Microsoft SDKs\Azure\AzCopy.
If you installed the 64-bit version, it's located here: %ProgramFiles%\Microsoft
SDKs\Azure\AzCopy.
https://storageaccountname-secondary.blob.core.windows.net/vhds/
BlobName.vhd
o SAS token: Use an SAS token to access data from the endpoint. For more
information, see Using shared access signatures.
How do I use an HTTPS custom domain with my storage account? For example, how do
I make "https://mystorageaccountname.blob.core.windows.net/images/image.gif"
appear as "https://www.contoso.com/images/image.gif"?
SSL is not currently supported on storage accounts with custom domains. But you can use
non-HTTPS custom domains. For more information, see Configure a custom domain name
for your Blob storage endpoint.
There is no way to access a storage account directly by using FTP. However, you can set up
an Azure virtual machine, and then install an FTP server on the virtual machine. You can
have the FTP server store files on an Azure Files share or on a data disk that is available to
the virtual machine.
If you want only to download data without having to use Storage Explorer or a similar
application, you might be able to use an SAS token. For more information, see Using shared
access signatures.