Pre-Seeding DFS Replication on Windows Server 2012 with Robocopy

When I upgraded a file server from Windows Server 2008 R2 to Windows Server 2012, letting DFS Replication (DFSR) do the initial sync took far too long because it was pulling everything from a remote server. Pre-seeding the new server with Robocopy from a local copy ran at line speed and finished much faster.

The Robocopy Pre-Seed Command

robocopy.exe "\\sourceserver\d$" "d:" /b /e /copyall /r:6 /xd dfsrprivate /log:robo.log /tee /MT
  • /b copies in backup mode, /e includes all subfolders, and /copyall keeps permissions, owners, and timestamps so DFSR sees matching files.
  • /xd dfsrprivate skips the DFSR private folder.
  • /MT runs a multi-threaded copy, and /log with /tee writes to a log and the console.

Verify File Hashes Before Adding the Server to DFS

Before you add a pre-seeded server to DFS, spot-check that files and folders are identical on both sides. Matching hashes mean DFSR only has to sync the deltas, which makes the cut-over between old and new servers much faster.

C:\Windows\system32>dfsrdiag filehash /filepath:\\onrfs01\d$\vacancy_monitoring
File Hash: DBCCC7FA-E523939F-835B14D5-31020191
Operation Succeeded

C:\Windows\system32>dfsrdiag filehash /filepath:\\onrfs02\d$\vacancy_monitoring
File Hash: DBCCC7FA-E523939F-835B14D5-31020191
Operation Succeeded

Bonus: Turn On Data Deduplication

Don’t forget Windows Server 2012’s Data Deduplication feature. Enabling it saved me 20 to 30 percent of disk space on my file servers.