Windows 2019
Sponsored Link

File Server : Configure DFS Replication2021/01/15

 
Configure DFS Replication groups.
To configure DFS Replication, it's possible to replicate data in a target folder on a server to other servers.
This example is based on the Active Directory Domain environment like follows.
                                   |
+----------------------+           |           +----------------------+
|  [ fd3s.srv.world ]  |10.0.0.100 | 10.0.0.101|  [ rx-7.srv.world ]  |
|   Active Directory   +-----------+-----------+     File Server #1   |
|                      |           |           |    DFS Replication   |
+----------------------+           |           +----------------------+
                                   |
                                   |           +----------------------+
                                   | 10.0.0.102|  [ rx-8.srv.world ]  |
                                   +-----------+     File Server #2   |
                                               |    DFS Replication   |
                                               +----------------------+

[1] Run PowerShell with Admin Privilege and Configure DFS Replication on the branch (source) server.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# create a DFS replication group (any name are OK)
PS C:\Users\serverworld> New-DfsReplicationGroup -GroupName "RepGroup01" 

GroupName   : RepGroup01
DomainName  : srv.world
Identifier  : 25fd44e0-899c-4a75-b252-2d338c1b2cb6
Description :
State       : Normal

# set member servers for the replication group
PS C:\Users\serverworld> Add-DfsrMember -GroupName "RepGroup01" -ComputerName "rx-7","rx-8" 

GroupName                    : RepGroup01
ComputerName                 : RX-7
DomainName                   : srv.world
Identifier                   : 3ca523d1-a643-4aff-a262-c78556f1dcb1
Description                  :
DnsName                      : rx-7.srv.world
Site                         : Default-First-Site-Name
NumberOfConnections          : 0
NumberOfInboundConnections   : 0
NumberOfOutboundConnections  : 0
NumberOfInterSiteConnections : 0
NumberOfIntraSiteConnections : 0
IsClusterNode                : False
State                        : Normal

GroupName                    : RepGroup01
ComputerName                 : RX-8
DomainName                   : srv.world
Identifier                   : aa06c01c-897f-4f7d-aa02-51a109036ce3
Description                  :
DnsName                      : rx-8.srv.world
Site                         : Default-First-Site-Name
NumberOfConnections          : 0
NumberOfInboundConnections   : 0
NumberOfOutboundConnections  : 0
NumberOfInterSiteConnections : 0
NumberOfIntraSiteConnections : 0
IsClusterNode                : False
State                        : Normal

# set a connection between members of the replication group
# -SourceComputerName [branch (source) server]
# -DestinationComputerName [hub (destination) server]
PS C:\Users\serverworld> Add-DfsrConnection -GroupName "RepGroup01" `
-SourceComputerName "rx-7" `
-DestinationComputerName "rx-8" 


GroupName               : RepGroup01
SourceComputerName      : RX-7
DestinationComputerName : RX-8
DomainName              : srv.world
Identifier              : 6ce50a3d-509b-40d2-96bf-ab337dddcfca
Enabled                 : True
RdcEnabled              : True
CrossFileRdcEnabled     : True
Description             :
MinimumRDCFileSizeInKB  : 64
State                   : Normal

GroupName               : RepGroup01
SourceComputerName      : RX-8
DestinationComputerName : RX-7
DomainName              : srv.world
Identifier              : 7e524f48-fff4-4492-835d-9698b1331e0d
Enabled                 : True
RdcEnabled              : True
CrossFileRdcEnabled     : True
Description             :
MinimumRDCFileSizeInKB  : 64
State                   : Normal

# create a target folder for replication
PS C:\Users\serverworld> mkdir D:\Replica01 

# set folder name (any name are OK)
PS C:\Users\serverworld> New-DfsReplicatedFolder -GroupName "RepGroup01" -FolderName "Replica01" 

GroupName              : RepGroup01
FolderName             : Replica01
DomainName             : srv.world
Identifier             : 178de091-7cb1-4fe7-b479-393fbcb7e5e3
Description            :
FileNameToExclude      : {~*, *.bak, *.tmp}
DirectoryNameToExclude : {}
DfsnPath               :
IsDfsnPathPublished    : False
State                  : Normal

# set physical path of the replication folder on the branch server
PS C:\Users\serverworld> Set-DfsrMembership -GroupName "RepGroup01" `
-FolderName "Replica01" `
-ContentPath "D:\Replica01" `
-ComputerName "rx-7" `
-PrimaryMember $True 

GroupName                   : RepGroup01
ComputerName                : RX-7
FolderName                  : Replica01
GroupDomainName             : srv.world
ComputerDomainName          : srv.world
Identifier                  : 0e5199cc-9e4c-4141-bee9-b5c3d46f2e46
DistinguishedName           : CN=178de091-7cb1-4fe7-b479-393fbcb7e5e3,CN=affc6a48-ed0b-4f33-a3e3-209f80ee7323,CN=DFSR-LocalSettings,CN=RX-7,CN=Computers,DC=srv,DC=world
ContentPath                 : D:\Replica01
PrimaryMember               : True
StagingPath                 : D:\Replica01\DfsrPrivate\Staging
StagingPathQuotaInMB        : 4096
MinimumFileStagingSize      : Size256KB
ConflictAndDeletedPath      : D:\Replica01\DfsrPrivate\ConflictAndDeleted
ConflictAndDeletedQuotaInMB : 4096
ReadOnly                    : False
RemoveDeletedFiles          : False
Enabled                     : True
DfsnPath                    :
State                       : Normal

# set physical path of the replication folder on the hub server
PS C:\Users\serverworld> Set-DfsrMembership -GroupName "RepGroup01" `
-FolderName "Replica01" `
-ContentPath "D:\Replica01" `
-ComputerName "rx-8" 

GroupName                   : RepGroup01
ComputerName                : RX-8
FolderName                  : Replica01
GroupDomainName             : srv.world
ComputerDomainName          : srv.world
Identifier                  : f802270c-5980-4e18-b1e1-567d1cee77f0
DistinguishedName           : CN=d200b467-caeb-42fa-9f2c-9a025972dd4b,CN=e70178af-00c6-4d92-9c77-c499cc4361d6,CN=DFSR-LocalSettings,CN=RX-8,CN=Computers,DC=srv,DC=world
ContentPath                 : D:\Replica01
PrimaryMember               : False
StagingPath                 : D:\Replica01\DfsrPrivate\Staging
StagingPathQuotaInMB        : 4096
MinimumFileStagingSize      : Size256KB
ConflictAndDeletedPath      : D:\Replica01\DfsrPrivate\ConflictAndDeleted
ConflictAndDeletedQuotaInMB : 4096
ReadOnly                    : False
RemoveDeletedFiles          : False
Enabled                     : True
DfsnPath                    :
State                       : Normal

# confirm current replication state
PS C:\Users\serverworld> Get-DfsrCloneState 
Ready

# verify settings to create test files or folders in the replication folder
PS C:\Users\serverworld> mkdir D:\Replica01\testfolder 
PS C:\Users\serverworld> echo "Test File" > D:\Replica01\testfile.txt 
PS C:\Users\serverworld> ls D:\Replica01 

    Directory: D:\Replica01

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        1/14/2021  11:13 PM                testfolder
-a----        1/14/2021  11:12 PM             24 testfile.txt

PS C:\Users\serverworld> ssh rx-8 powershell -c "Get-ChildItem D:\Replica01" 
fd3s01\serverworld@rx-8's password:

    Directory: D:\Replica01

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        1/14/2021  11:13 PM                testfolder
-a----        1/14/2021  11:12 PM             24 testfile.txt


PS C:\Users\serverworld> ssh rx-8 powershell -c "echo 'Replication Test' >  D:\Replica01\testfolder\testfile2.txt" 
fd3s01\serverworld@rx-8's password:

PS C:\Users\serverworld> ls D:\Replica01\testfolder 

    Directory: D:\Replica01\testfolder

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        1/15/2021  12:15 AM             18 testfile2.txt
File Server : Configure DFS Replication (GUI)
 
On GUI configuration, set like follows.
[2] Run [Start] - [Server Manager] - [Tools] - [DFS Management].
[3] Right click the [Replication] on the left pane and open the [New Replication Group] on the menu.
[4] For simply 2 server's replication group, check a box [Replication group for data collection].
If you'd like to use more than 3 servers or use advansed configuration options even if 2s servers, choose [Multipurpose replication group].
(proceed with [Replication group for data collection] on this example)
[5] Input any replication group name and description and click [Next] button.
[6] Specify the branch (source) server for replication and click [Next] button.
[7] Specify the replicated folders on the branch server, click [Add] button.
[8] Select the path of replicated folders and click [OK].
[9] Specify the hub (destination) server for replication and click [Next] button.
[10] Specify the target folders on the hub server for replication.
[11] Specify the replication schedule and bandwidth. By default settings, repliation task is always enabled, data are replicated at once if changes are detected in the target folders and also full bandwidth is used. If you'd like to set specified schedules or limit bandwidth configure them with the lower option.
[12] Confirm selections and click [Create] button if that's OK.
[13] That's OK if all tasks are [Success], click [Close] button to finish.
[14] Created replication groups are displayed on the DFS management.
[15] Verify settings to put files or folders on the tgarget replication folders.
Matched Content