To migrate Azure NetApp Files from one subscription to another using Robocopy, you can follow these steps:
- Deploy a Windows virtual machine (VM) in Azure in the same region as your source Azure NetApp Files volume. Keeping the data and networking in Azure will be fast and avoid outbound data transfer charges. For optimal performance, we recommend a multi-core VM type with at least 56 GiB of memory, for example Standard_DS5_v2.
- Mount both the source and target Azure NetApp Files volumes to the VM. Be sure to mount them using the storage account key to make sure the VM has access to all the files. Don't use a domain identity.
- Run the following command at the Windows command prompt. Optionally, you can include flags for logging features as a best practice (/NP, /NFL, /NDL, /UNILOG).
robocopy <source> <target> /MIR /COPYALL /MT:16 /R:2 /W:1 /B /IT /DCOPY:DAT
If your source volume was mounted as s:\ and target was t:\ the command looks like this:
robocopy s:\ t:\ /MIR /COPYALL /MT:16 /R:2 /W:1 /B /IT /DCOPY:DAT
- After the initial run completes, disconnect your application from the existing volume and run the same robocopy command again. This will copy over all the changes that happened since the initial run, skipping any file data that has already copied over.
- After the command completes for the second time, you can redirect your application to the new volume.
Note: If the source Azure NetApp Files volume is AD-joined, you may not be able to create a target volume with the same AD. In this case, you can create a new volume and use Robocopy to migrate the data to the new volume.
References: