Introduction to DFS Replication for File Server Redundancy

Distributed File System Replication (DFSR) is a Windows Server 2019 feature that provides multi-master, state-based replication of file data between servers. Unlike the deprecated FRS (File Replication Service), DFSR uses the Remote Differential Compression (RDC) algorithm to replicate only the changed portions of files, dramatically reducing replication bandwidth. DFSR is the foundation for SYSVOL replication on Active Directory domain controllers, and it is widely used for creating redundant file servers — allowing users to access the same shared folders from multiple servers, providing both high availability and geographic load distribution. This guide covers planning a DFSR topology, installing the role, configuring replication groups and replicated folders, and monitoring replication health.

Planning the DFS Replication Topology

Before deploying DFSR, plan the following:

Members: The servers participating in replication. For a two-site high availability setup, you typically have two members — one at the primary site and one at the secondary/DR site. Replication Group: A logical container that groups the members and defines what is replicated between them. Replicated Folder: A specific folder path on each member that is synchronized. Connections: Directional network connections between members. In a hub-and-spoke topology, hub servers replicate to and from multiple branch servers. In a mesh topology (recommended for two or three members), all members replicate directly to all other members. Staging Quota: A buffer area where changed files are staged before and after replication. Set the staging quota to at least the size of the 32 largest files in the replicated folder.

Installing DFS Replication on Windows Server 2019

Install the DFS Replication role service on each participating server. Run the following on all servers that will be DFSR members:

Install-WindowsFeature -Name FS-DFS-Replication -IncludeManagementTools

The DFS Management snap-in (dfsmgmt.msc) is installed on the server you designate as the management workstation (typically the primary server). Install DFS Namespace if you also want to configure a unified namespace under which the replicated folders are accessible:

Install-WindowsFeature -Name FS-DFS-Namespace -IncludeManagementTools

Creating a Replication Group

Open DFS Management (dfsmgmt.msc). In the left pane, click Replication and select New Replication Group from the Actions pane. The New Replication Group Wizard launches.

Select Multipurpose replication group for general-purpose file replication (select Replication group for data collection only if replicating data in one direction from branches to hub). Name the group (e.g., Finance-FileShare-RG). Add the member servers (e.g., FILESERVER01 and FILESERVER02). Configure the topology — Full mesh for two members (both replicate to each other), Hub and spoke for three or more members where bandwidth control is important.

Set the replication schedule and bandwidth. Choose to replicate continuously at full bandwidth for LAN connections, or schedule replication during off-peak hours with bandwidth throttling for WAN links. Click Next and specify the primary member — the server whose content is authoritative for the initial synchronization (its files overwrite files on other members during the first sync).

Configuring a Replicated Folder

In the wizard, add the replicated folder. Specify the local path on the primary member (e.g., D:SharesFinance). DFS Management automatically configures the same path on other members, or you can specify different local paths per member. Leave File and subfolder filters at the default (DfsrPrivate, *.tmp) and add any application-specific temporary file extensions to exclude from replication.

Configure the staging folder location and quota for each member. The default staging location is a hidden subfolder within the replicated folder (D:SharesFinanceDfsrPrivateStaging). Best practice is to place the staging folder on the same volume as the replicated folder to avoid cross-volume I/O overhead.

Alternatively, configure replication via PowerShell for automation:

New-DfsReplicationGroup -GroupName "Finance-FileShare-RG" -DomainName "corp.example.com"

Add-DfsrMember -GroupName "Finance-FileShare-RG" -ComputerName "FILESERVER01", "FILESERVER02"

New-DfsReplicatedFolder -GroupName "Finance-FileShare-RG" -FolderName "Finance" -DomainName "corp.example.com"

Set-DfsrMembership -GroupName "Finance-FileShare-RG" -FolderName "Finance" -ComputerName "FILESERVER01" -ContentPath "D:SharesFinance" -StagingPathQuotaInMB 4096 -PrimaryMember $true

Set-DfsrMembership -GroupName "Finance-FileShare-RG" -FolderName "Finance" -ComputerName "FILESERVER02" -ContentPath "D:SharesFinance" -StagingPathQuotaInMB 4096 -PrimaryMember $false

Add-DfsrConnection -GroupName "Finance-FileShare-RG" -SourceComputerName "FILESERVER01" -DestinationComputerName "FILESERVER02"

Monitoring DFS Replication Health

Check replication backlog (the number of files waiting to be replicated) using the dfsrdiag command:

dfsrdiag backlog /rgname:"Finance-FileShare-RG" /rfname:"Finance" /smem:FILESERVER01 /rmem:FILESERVER02

A large backlog indicates replication is falling behind — investigate network throughput, staging quota, or anti-virus exclusions. Check the DFS Replication event log for errors:

Get-WinEvent -LogName "DFS Replication" -MaxEvents 50 | Where-Object { $_.LevelDisplayName -ne "Information" } | Select-Object TimeCreated, LevelDisplayName, Message | Format-List

Key DFSR event IDs: 2104 (replication stopped due to staging quota exceeded), 4002 (connection established), 4004 (connection terminated), 5002 (USN journal wrap — critical, requires re-synchronization). Generate a replication health report from DFS Management by right-clicking the replication group and selecting Create Diagnostic Report.

Handling Replication Conflicts

When the same file is modified on two different members simultaneously (before the change from one member replicates to the other), DFSR detects a conflict. The later change wins, and the losing version is moved to the ConflictAndDeleted folder inside DfsrPrivate on the member that lost the conflict. Review conflict files periodically:

Get-DfsrPreservedFiles -GroupName "Finance-FileShare-RG" -FolderName "Finance" -ComputerName FILESERVER01

To reduce conflicts, implement file locking policies through the DFS Namespace (DFS-N) referral ordering to direct all users to a primary server, using the secondary server only for failover. This converts DFSR from active-active to active-passive for write operations, effectively eliminating multi-master write conflicts.