~/move a file share to a new server with robocopy
Copy a share's data, permissions and timestamps to a new server with Robocopy, then run a quick final pass out of hours so users barely notice the move.
Updated November 2026. Robocopy is now built into Windows (it used to need the Resource Kit). I’ve updated the command with the switches I’d use today, and mentioned the alternatives.
Robocopy is still one of the best ways to move a file share. Compared with a normal copy, it can:
- copy NTFS permissions, owners and auditing settings
- skip files that haven’t changed, so repeat runs are fast
- retry, log and run multi-threaded
1. Prepare the new share
Create the folder and share on the new server, with share permissions matching the old one. NTFS permissions come across with the copy.
2. Initial copy (during the day)
robocopy "\\OLDSERVER\Share" "\\NEWSERVER\Share" /MIR /COPYALL /DCOPY:DAT /B /R:1 /W:1 /MT:16 /XJ /NP /LOG:C:\Temp\robocopy-share.log /TEE
| Switch | What it does |
|---|---|
/MIR |
Mirror: copies everything, and deletes files at the destination that aren’t in the source |
/COPYALL |
Data, attributes, timestamps, NTFS permissions, owner and auditing |
/DCOPY:DAT |
Keeps folder attributes and timestamps too |
/B |
Backup mode, to copy files even where your account lacks permission |
/R:1 /W:1 |
One retry, one second apart, instead of the default million |
/MT:16 |
16 copy threads |
/XJ |
Skips junction points, avoiding loops |
/LOG ... /TEE |
Logs to a file and the screen |
Be careful with /MIR: get the source and destination the right way round, because it deletes from the destination. Run with /L first to list what it would do without changing anything.
On a big share this can take hours, but users can keep working.
3. Final pass (out of hours)
Make the old share read-only, then run the same command again. Only changed files are copied, so it’s quick.
4. Point users at the new location
Update drive mappings in Group Policy Preferences or logon scripts, and any shortcuts or applications that use the old path. When people log in the next morning, they won’t notice the data has moved.
Alternatives
- DFS Namespaces: if users connect via a namespace path such as
\\contoso.com\Files, you only change the target, not every mapping. Worth setting up for the next migration. - Storage Migration Service in Windows Admin Center moves whole file servers, including share settings, and can take over the old server’s name and IP address.