Solved: DFS error “The replication group is invalid”
Recently, 1 of my DFS replication groups stopped working with the following error:
Event Type: Error
Event Source: DFSR
Event Category: None
Event ID: 4004
The DFS Replication service stopped replication on the replicated folder at local path D:\DFS Targets\Legacy.
Error: 9003 (The replication group is invalid)
Additional context of the error: D:\DFS Targets\Legacy\
Replicated Folder Name: Legacy
Replicated Folder ID: B7384F60-E4B2-4686-BB69-B9BD93CF8398
Replication Group Name: villas.cck\dfs\legacy
Replication Group ID: 50A2B981-6B8E-43DD-9D53-B6DE3EC091E4
Member ID: 361EF048-BD7D-449C-A37D-657160F87FC5
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
A google search seemed to indicate that my DFS database had got corrupted on this particular server. Looking in “D:\System Volume Information\DFSR\database_300C_6040_C5F_FEEA”  I could see a file called $db_dirty$ whereas the other DFS server had a file called $db_clean$ so I was confident that I’d tracked down the problem.
After making sure I had all data backed up, I stopped the Distributed File System and DFS Replication services, moved the database_300C_6040_C5F_FEEA folder to the desktop then restarted the 2 services. The DFS service then re-built the database and replication started again.
Before doing this, I suggest reading through this article which talks about minimising the effect of re-initialising a DFS member
1 – To get access to the System Volume Information folder, you may need to edit the folder’s security settings to give your login permissions.