Steps for migrating existing service instances created with LRS to new instances with ZRS.
Ensure that the AzCopy
utility is installed on the machine where the migration will be performed. You can download it from Download AzCopy.
This migration is applicable for object store instances created with azure-standard plan on Cloud Foundry only.
-
Login to Cloud Foundry and the target to org / space where the existing service instance is present. Ensure that object store service access is still enabled in that org / space.
-
For the migration purpose, an SAS token is required. Either existing binding/service-key credentials of existing instance can be used, or you may create a new service-key for migration purpose, as long as the total count of bindings does not surpass the limit of 5.
-
Create a new service instance of object store with
azure-standard
plan. Create a service key for the same.The LRS based containers and ZRS based containers can be differentiated by the
zrs
suffix. LRS based containers would havesapcp-osaas-<service_instance_guid>
and ZRS based containers would havesapcp-osaas-<service_instance_guid>-zrs
. -
Execute following command using the respective SAS tokens obtained in service key credentials to initiate the migration activity. Please ensure that you remove
\u0026
from SAS tokens and replace it with&
:azcopy sync <source_container_uri_with_sas_token> <destination_container_uri_with_sas_token> --recursive=true
$ azcopy sync "https://<source_account_name>.blob.core.windows.net/<source_container_name>?sig=somesig&sv=2019-02-02&spr=https&si=633edea9-3e66-48ea-8f8c-d75bf3f0d75e&sr=c" "https://<destination_account_name>.blob.core.windows.net/<destination_container_name>?sig=someothersig&sv=2019-02-02&spr=https&si=56d09ea5-0712-4d90-94fe-c5017c6f0b03&sr=c" --recursive=true INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support Job a4b5eac1-b3e0-b94a-6c5a-2ed724fcbed6 has started Log file is located at: /Users/<user>/.azcopy/a4b5eac1-b3e0-b94a-6c5a-2ed724fcbed6.log 988 Files Scanned at Source, 101761 Files Scanned at Destination Job a4b5eac1-b3e0-b94a-6c5a-2ed724fcbed6 Summary Files Scanned at Source: 1373 Files Scanned at Destination: 101761 Elapsed Time (Minutes): 3.2678 Number of Copy Transfers for Files: 0 Number of Copy Transfers for Folder Properties: 0 Total Number Of Copy Transfers: 0 Number of Copy Transfers Completed: 0 Number of Copy Transfers Failed: 0 Number of Deletions at Destination: 0 Total Number of Bytes Transferred: 0 Total Number of Bytes Enumerated: 0 Final Job Status: Completed
Please note that above command may take minutes / hours depending on the number and sizes of blobs present in source and destination containers. Also, once this command completes successfully, the same command can be run again to check if sync activity from source to destination has copied all the blobs.
-
Use log files generated by the
az-copy
command internally, in case you need to identify any errors. For more information on how to access the log files, see the following documentation Find errors and resume jobs by using log and plan files in AzCopy.To understand how you could ensure that there are no performance issues during
az-copy
command execution, see Optimize for large numbers of small files. -
Once the migration is complete and after you verify that all the data has been copied to new container successfully, you must delete the old instances after deleting its bindings/service-keys.
-
Rename the new instance with the old instance name, once the old instance is deleted. You may choose to delete the service-key for new instance as well.