DFS Replication is a Role of Windows Server that can use it to replicate File Servers across LAN or Internet.
DFS (Distributed File System) Replication use a compression algorithm as remote differential compression (RDC) to replicate only the changes in file block instead of the entire file. If you need more details you can find in Technet https://technet.microsoft.com/en-us/library/jj127250(v=ws.11).aspx.
Last month i face an issue while try to migrate my File Server from Esxi to HYPERV. File Server is almost 1.5 TB and i didn't have any tool to copy all my files or full VM through weekend in new HYPERV Host.
My backup is for Esxi , my replication the same. I try to use MVMC to convert the VM but the time wasn't enough to complete thought weekend.
Robocopy it's very good solution but i see that the time wasn't enough to transfer 1.5 TB include millions of files. So what must i do to resolve this problem?
DFS Replication was the best solution in this scenario and not only. So today i would like to share and explain how can install and configure DFS Role to Replicate your File Servers.
Install Role of DFS Replication
First thing is to install the DFS Replication Role in every Windows Server that you want to Replicate. In this Scenario we have 2 File Servers for Replication. (FILESERVER and FILESERVER-HV) and 1 Domain Controller.
Before proceed it's very important to know what you must never do when use File Server with DFSR Role to avoid unexpected replication and loss of data.
Now we can start.
- Open Server Manager
- Select Manage - - > Add Roles & Features
- In the first screen click Next.
- Leave the Role-base or Feature-based installation and click Next.
- Leave the deafult options and click Next.
- Expand File Storage Services - - > File & iSCSI Services and check DFS Replication.
- Click Add Features to return in first screen and click Next.
- Click Install and wait to finish the Installation.
Create new Replication Group
After finish the installation go back in Server Manager and select Tools - - > DFS Management.
- Right Click in Replication and select New Replication Group.
- Because we have only 2 Servers will select the second options Replication group for data collection.
- Click Next. Type the name of the Replication group and click Next.
- Click Browse to find the source server. Click Next.
- Click Browse to select the folder that you want to replicate and click Ok.
- Now clcik Browse to select the destination Server. Click Next.
- Select the target folder. But be carefull you don't need to create the root folder in the destination because if select the target folder User as in example will be create the Path E:\Users\Users. We don't want this. Just select the one level before and the replication will be create the Folder. Click Next.
- Select if will be replicate continuously or schedule when start and finish the Replication. In production enviroment with large Folders it's better to schedule the replication in non working hours. But now i will select Replicate continuously. You can configure the Bandwith but we don't want it. Just keep it Full.
- Just a confirmation of your settings. Click Create.
- Wait to create the Replication Group.
After create the Replication Group it's very important to configure some settings for better performance.
- From the console of DFS Management click in Replication and you will see the new Group.
- If you click on the Group in the right side you will see four Tabs and the Staging Quota in 4 GB. What is Staging Quota? DFS Replication uses staging folders for each replicated folder to act as caches for new and changed files that are ready to be replicated from sending members to receiving members. These files are stored under the local path of the replicated folder in the DfsrPrivate\Staging folder
- Let's start with the Membership Tab.
- Go down in Replicated Folders, right click one of them and select Properties.
- Click in Tab Staging and click in Quota. The default is 4 GB. The Staging is one of the most important settings because you can avoid perfomance issue in replication.
- In large folders it's recommended to change staging Quota more than 4 GB. How can calculate what is the better settings for your enviroment?
- Just go in https://technet.microsoft.com/library/dn465158.aspx and read carefull how can optimize the staging.
- After understand and find what is your right quota for your enviroment , change it and click OK.
- In Connection Tab with right click in one of the Members you can Disable the Replication or force the Replication Now.
- In Tab Replication Folders you must configure another one important setting. Right click in folder and select Properties.
- In File filter you can see default values the .bak,.tmp extension of files. This means that these types of Files will not be replicated.
- In case that you have these types of Files you must remove it. Unless the replication will be work properly but the folders will not be replicated with all the files. Also you can use it to exclude file types of your replication.
- In the Tab Delegation you can see How the permissions granted. It's better to don't change anything here.
After that wait to Replicate all the folders from one server to another. If you have large folders must wait hours and maybe days for the first Replication. It's the only disadvantage that i can find in this feature. I will continue to explan DFS Replication with new Articles to explain more features and also how can use it with Powershell.
I hope this week to find something intresting.
Have a nice weekend!!
Now it's your turn to tell us your experience and any issue that you have face with DFS Replication in our commented system.