Moving azure blobs to another region - azure

I have a storage account with over 600k blobs.
I want to move them to another storage account, in a different region.
After googling I found someone recommending "Azure storage explorer". When I tried it, it was extremely slow. It looked like it was going to take about a week to transfer them all, but then after 24 hours, it has cancelled the copy and I can see no option to restart it.
Is there a fast and convenient way of moving a large number of blobs from one storage account, in one region, to another storage account, in another region?

You are looking for the command,
azcopy
Example,
azcopy cp "https://<source-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>?<SAS-token>" "https://<destination-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>"
Read more here

Related

Speeding up blob copying on Azure

I have a use case which often requires to copy a blob (file) from one Azure region to another. The file size spans from 25 to 45GB. Needless to say, this sometimes goes very slowly, with inconsistent performance. This might take up to two hours, sometimes more. Distance plays a role, but it differs. Even within the same region copying is slower then I would expect. I've been trying:
The Python SDK, and its copy blob method from the blob service.
The rest API copy blob
az copy from the CLI.
Although I didn't really expect different results, since all of them use the same backend methods.
Is there any approach I am missing? Is there any way to speed up this process, or any kind of blob sharing integrated in Azure? VHD/disk sharing could also do.
You may want to try /SyncCopy option in AzCopy:
Synchronously copy blobs from one storage account to another
AzCopy by default copies data between two storage endpoints asynchronously. Therefore, the copy operation runs in the background using spare bandwidth capacity that has no SLA in terms of how fast a blob is copied, and AzCopy periodically checks the copy status until the copying is completed or failed.
The /SyncCopy option ensures that the copy operation gets consistent speed. AzCopy performs the synchronous copy by downloading the blobs to copy from the specified source to local memory, and then uploading them to the Blob storage destination.
AzCopy /Source:https://myaccount1.blob.core.windows.net/myContainer/ /Dest:https://myaccount2.blob.core.windows.net/myContainer/ /SourceKey:key1 /DestKey:key2 /Pattern:ab /SyncCopy
/SyncCopy might generate additional egress cost compared to asynchronous copy, the recommended approach is to use this option in an Azure VM that is in the same region as your source storage account to avoid egress cost.
In linux you can try using --parallel-level option. Try looking it up using azcopy --help. Also, the max op limit is 512 officially. Go bonkers!

Azure blob storage backup

I wonder is there's an inbuilt way in azure to backup a blob account, or just a container if that can't be done. Looked into azure backup service but can't find the option for doing it, just options to backup VM.
Alternatively I can write my custom back up strategy, but not sure if it's the case that I can't find that option inbuilt.
Thanks,
There is no blob backup facility. You'll need to make your own backups (e.g. making copies of blobs, either to the same storage account or a different one). You can take snapshots, but as #Gaurav points out in comments, snapshots are tied to the original blob, so if you delete the original, you delete the snapshots.
I answered a similar question regarding backups and Table Storage, as well, here.

How to clone blob container and contents

Summary
I have picked up support for a fairly old website which stores a bunch of blobs in Azure. What I would like to do is duplicate all of my blobs from live to the test environment so I can use them without affecting users.
Architecture
The website is a mix of VB webforms and MVC, communicating with an Azure blob service (e.g. https://x.blob.core.windows.net/LiveBlobs).
The test site mirrors the live setup, except it points to a different blob container in the same storage account (e.g. https://x.blob.core.windows.net/TestBlobs)
Questions
Can I copy all of the blobs from live to test without downloading
them? They would need to maintain the same names.
How do I work out what it will cost to do this? The live blob
storage is roughly 130GB, but it should just be copying the data within the same data centre right?
Things I've investigated
I've spent quite some time searching for an answer, but what I've found deals with copying between storage accounts or copying single blobs.
I've also found AzCopy which looks promising but it looks like it would copy the files one by one so I'm worried it would end up taking a long time and costing a lot.
I am fairly new to Azure so please forgive me if this is a silly question or I've missed out some important details. I'm more than happy to add any extra information should you need it.
Can I copy all of the blobs from live to test without downloading
them? They would need to maintain the same names.
Yes, you can. Copying blob is an asynchronous server-side operation. You simply tell the blob service the blobs to copy & destination details and it will do the job for you. No need to download first and upload them to destination.
How do I work out what it will cost to do this? The live blob storage
is roughly 130GB, but it should just be copying the data within the
same data centre right?
So there are 3 things you need to consider when it comes to costing: 1) Storage costs, 2) transaction costs and 3) data egress costs.
Since the copied blobs will be stored somewhere, they will be consuming storage and you will incur storage costs.
Copy operation will perform some read operations on source blobs and then write operation on destination blobs (to create them), so you will have to incur transaction costs. At very minimum for each blob copy, you can expect 2 transactions - read on source and write on destination (though there can be more transactions).
You incur data egress costs if the destination storage account is not in the same region as your source storage account. As long as both storage accounts are in the same region, you would not incur this.
You can use Azure Storage Pricing Calculator to get an idea about how much it is going to cost you.
I've also found AzCopy which looks promising but it looks like it
would copy the files one by one so I'm worried it would end up taking
a long time and costing a lot.
Blobs are always copied one-by-one. Copying across storage accounts is always async server side operation so you can't really predict how much time it would take for the copy operation to complete but in my experience it is quite fast. If you want to control when the blobs are copied, you would need to download them first and upload them. AzCopy supports this mode as well.
As far as costs are concerned, I think it is a relative term when you say it is going to cost a lot. But in general Azure Storage is very cheap and 130 GB is not a whole lot of data.

Fastest way to move Azure VMS from one subscription on one account to another subscription in another account

I have on my account one windows server with IIS and one OS disk which is 127gb.
I also have another sql server with the os disk also 127gb and 3 additional disks, one for the tempdb, another one for datafiles and another one for the logs.
The application is very critical, and we need to change it to another account. However the maintenance window cant be more than 2 hours.
What is the fastest way to copy the VHDS from one location to the other account?
I tried cloudberry explorer adding the storage accounts and just copying the files, but its been more than 5 minutes and it has only copies 5% of one 127GB file.
Maybe this tool is using my computer as a temp location while it copies to the next storage account?
Is there a faster way?
The recommended way is to use AzCopy as below documentation link suggests.
https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/#blob-copy
If you have heard about PowerShell command Start-AzureStorageBlobCopy it will give you almost same duration: Link
Another way is to use hands of Azure operator.
Submit a support ticket and they can help you to move a Storage to another subscription. If you prepare Virtual machine image, it will be achieved less than 1 hour downtime (hopefully?).

Is copying blob within the same Azure storage account instant?

I'm using the StartCopyFromBlob to copy a 2GB blob from container A to container B within the same storage account. I noticed that it's an instant operation as the CopyState status is Success right away. This is very good for us, so want to confirm that we can actually rely on this.
I can't find any MSDN document about this "copy optimization" when copying within the same storage account. Is there a document on this copy behavior within the same account? Just want to make sure it is officially supported.
Only storage accounts created on or after June 7th, 2012 allow the Copy Blob operation to copy from another storage account. http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx
you might find this post interesting: Introducing Asynchronous Cross-Account Copy Blob http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/12/introducing-asynchronous-cross-account-copy-blob.aspx
I hope this helps let me know if you need anything else.

Resources