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

{% hint style="warning" %}
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>
{% endhint %}

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

{% stepper %}
{% step %}

### 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.
{% endstep %}

{% step %}

### 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).
{% endstep %}

{% step %}

### 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

```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.
{% endstep %}

{% step %}

### 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.
{% endstep %}

{% step %}

### 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.
{% endstep %}
{% endstepper %}

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
