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.

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

1

Prepare an Azure VM

Deploy a Windows VM in Azure in the same region as the source file share. This keeps data and networking in Azure (faster, avoids outbound data transfer charges). For optimal performance, a multi-core VM with at least 56 GiB memory (for example Standard_DS5_v2) is recommended.

2

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).

3

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:DAT

Note: Running while the source is online is allowed, but the IOPS and throughput used count against the file share limits.

4

Run Robocopy again to capture changes

After the initial run completes, run the same Robocopy command again to copy changes made since the initial run. Unchanged data is skipped.

5

Repeat as needed before cutover

Repeat the previous step as many times as necessary until you're ready to cut over to the new file share.

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?