I need to move storge data from one region to another , but with azcopy metadata is changing how can i copy data fast and with same metadata.

Mritunjay Singh 0 Reputation points
2024-10-17T08:58:20.4833333+00:00

I want to move the storage from one region to another and metadata should not change. By default its changing to lower case . Iwant it in same way as it is in Primary region.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,185 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,876 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 11,206 Reputation points
    2024-10-17T17:53:28.5966667+00:00

    Hello Mritunjay Singh,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are moving storage data from one region to another, but metadata is changing while using AzCopy.

    First thing to do is to make sure you are using the latest version of AzCopy such as v10 not v8 and below, there is improvements or bug fixes related to metadata handling.

    Yes, using the --preserve-metadata will ensure that you are adding the --preserve-metadata flag correctly during your AzCopy operations. For an instant use similar to:

    azcopy copy "https://<source_storage_account>.blob.core.windows.net/<container_name>" "https://<destination_storage_account>.blob.core.windows.net/<container_name>" --recursive --preserve-metadata
    

    Thirdly, case-sensitivity of metadata could be forcing metadata to lowercase. Azure Storage metadata is technically case-insensitive, but it’s still important to verify how the service is handling it. If the default AzCopy behavior is still changing the metadata to lowercase, using custom scripts via Azure CLI or PowerShell to get and set metadata explicitly could offer more granular control. For an example using Azure CLI:

    # Get Metadata:
    az storage blob metadata show --account-name <source_account> --container-name <container> --name <blob>
    # Set Metadata:
    az storage blob metadata update --account-name <destination_account> --container-name <container> --name <blob> --metadata key1=value1 key2=value2
    

    Read more from the link below:

    https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?tabs=dnf

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.