Migrate Files Between SMB Azure file shares
Summary
This article explains how to migrate files between SMB Azure file shares using Robocopy (Windows command-line copy utility). It covers when this method is applicable, recommends running the migration from an Azure VM in the same region for performance and to avoid egress charges, shows the Robocopy command to use, and recommends repeating the Robocopy run to capture changes before cutover. It also warns that Azure File Sync migrations use a different process.
If you're using Azure File Sync, do not follow this procedure. See: https://docs.azure.cn/en-us/storage/file-sync/file-sync-share-to-share-migration
Applies to
This approach applies to SMB Azure file shares across various management, billing, media tier, and redundancy configurations.
SMB is supported; NFS is not supported for these listed configurations.
Migrate using Robocopy
Mount source and target shares
Mount both the source and target file shares to the VM. Ensure the VM can access all files by mounting the Azure file share with admin-level access β either identity-based access with admin-level Azure RBAC roles (recommended) or with the storage account key (less secure).
Run Robocopy (initial copy)
Run Robocopy from the Windows command prompt. Replace s:\ and t:\ with the mounted source and target paths. You can add logging flags (/NP, /NFL, /NDL, /UNILOG) as a best practice.
console
robocopy s:\ t:\ /MIR /COPYALL /MT:16 /R:2 /W:1 /B /IT /DCOPY:DATNote: Running while the source is online is allowed, but the IOPS and throughput used count against the file share limits.
See also
https://docs.azure.cn/en-us/storage/common/storage-use-azcopy-files
https://docs.azure.cn/en-us/storage/files/storage-files-migration-robocopy
https://docs.azure.cn/en-us/storage/file-sync/file-sync-share-to-share-migration
Last updated: 12/26/2025
Was this helpful?