When migrating DFS (Distributed File System) replication groups, you need to follow a specific process to ensure data integrity and minimize downtime. The dfsrmig command-line tool is the standard Microsoft method for migrating DFS replication groups between states.
This guide walks through the DFSR migration process step by step, showing you how to use dfsrmig commands to safely migrate your replication groups through the required migration states.
TL;DR
- Check current state:
dfsrmig /getglobalstate - Migrate to state 1:
dfsrmig /setglobalstate 1, then check withdfsrmig /getmigrationstate - Migrate to state 2:
dfsrmig /setglobalstate 2, check state - Migrate to state 3:
dfsrmig /setglobalstate 3, check state - Monitor at each step: Check migration state after each transition
- Complete process: Follow all three states in order for successful DFSR migration
What Is DFSR Migration?
DFSR (Distributed File System Replication) migration is the process of moving DFS replication groups from one state to another. The most common scenario is migrating from FRS (File Replication Service) to DFSR for SYSVOL replication.
When Is DFSR Migration Required?
DFSR migration is required when:
- Migrating from Windows Server 2008 or earlier: These versions used FRS (File Replication Service) for SYSVOL replication. FRS is deprecated and not supported on Windows Server 2016 and later.
- Introducing Windows Server 2016 or later domain controllers: If your domain still uses FRS, you cannot promote a Windows Server 2016+ domain controller until you migrate to DFSR. The promotion will fail with an error indicating FRS is deprecated.
- Upgrading to Windows Server 2016 or later: Before upgrading domain controllers to Windows Server 2016+, you must complete the FRS to DFSR migration.
DFSR migration is NOT required when:
- Already on Windows Server 2016 or later: These versions only support DFSR, not FRS. If your domain was created on Windows Server 2012 R2 or later, it likely already uses DFSR by default.
- Domain created on Windows Server 2012 R2 or later: Domains created on these versions default to DFSR, so no migration is needed.
- Only using Windows Server 2012/2012 R2: While these versions support both FRS and DFSR, if you're staying on these versions and already using DFSR, no migration is needed.
FRS Deprecation Timeline
- Windows Server 2008 and earlier: Used FRS for SYSVOL replication
- Windows Server 2012/2012 R2: Support both FRS and DFSR (DFSR is recommended)
- Windows Server 2016 and later: FRS is completely deprecated. Only DFSR is supported. Attempting to promote a Windows Server 2016+ DC in a domain using FRS will fail.
Bottom line: If you're migrating from Windows Server 2008 or earlier, or introducing Windows Server 2016+ domain controllers into an older domain, you must perform DFSR migration. If you're already on Windows Server 2016+ or your domain was created on Windows Server 2012 R2+, you're likely already using DFSR and don't need this migration.
Other Migration Scenarios
Beyond FRS to DFSR migration, the dfsrmig process can also be used for:
- Migrating DFSR replication groups to different configurations
- Preparing replication groups for major infrastructure changes
- Consolidating or reorganizing DFS replication topology
The migration process uses predefined states (0, 1, 2, 3) that must be progressed through sequentially. You cannot skip states or move backwards without significant complications.
Understanding Migration States
DFSR migration uses four main states:
- State 0 (Prepared): Initial state, replication group is ready for migration
- State 1 (Redirected): DFS namespace points to new replication group, but old replication still active
- State 2 (Eliminated): Old replication stopped, new replication active
- State 3 (Eliminated): Migration complete, cleanup possible
Prerequisites
Before starting the migration, ensure you have:
- Administrative access to all DFS servers in the replication group
- Backups of all data being replicated
- Documentation of current DFS namespace and replication group configuration
- A maintenance window for the migration
- All servers running compatible Windows Server versions
The Migration Process
The migration process follows a strict sequence. You must check the current state before moving to the next state, and verify that each state completes successfully before proceeding.
Step 1: Check Current Global State
Start by checking the current migration state:
dfsrmig /getglobalstate
This command displays the current global migration state for your DFS replication group. The output shows which state you're currently in and provides information about the replication group status.
Important: Always check the current state before making any changes. You need to know where you are in the migration process.
Step 2: Set Global State to 1 (Redirected)
Once you've verified the current state and are ready to begin migration, set the global state to 1:
dfsrmig /setglobalstate 1
This command starts the migration by moving to State 1 (Redirected). In this state:
- The DFS namespace begins pointing to the new replication target
- The old replication mechanism remains active
- Both old and new replication run in parallel initially
Warning: This is a one-way operation. Once you set the state, you cannot easily revert without following proper rollback procedures.
Step 3: Verify Migration State 1
After setting the state to 1, verify that the migration is progressing correctly:
dfsrmig /getmigrationstate
This command shows detailed information about the current migration state, including:
- Current migration state
- Replication group status
- Any errors or warnings
- Server-specific migration status
Important: Do not proceed to the next state until all servers show they've successfully completed State 1. Check the output carefully for any errors or warnings.
Step 4: Set Global State to 2 (Eliminated)
Once State 1 has completed successfully on all servers, advance to State 2:
dfsrmig /setglobalstate 2
State 2 (Eliminated) means:
- The old replication mechanism is stopped
- Only the new replication is active
- The migration is nearly complete
Critical: Ensure State 1 is fully complete before moving to State 2. Moving too quickly can cause replication issues.
Step 5: Verify Migration State 2
Check the migration state again to confirm State 2 is working correctly:
dfsrmig /getmigrationstate
Verify that:
- All servers show State 2
- No errors are present
- Replication is functioning correctly
- All data is synchronized
Step 6: Set Global State to 3 (Final State)
After State 2 is verified and stable, move to the final state:
dfsrmig /setglobalstate 3
State 3 completes the migration:
- Migration is fully complete
- Old replication components can be cleaned up
- The system is in its final migrated state
Step 7: Verify Final Migration State
Confirm the migration completed successfully:
dfsrmig /getmigrationstate
At this point, all servers should show State 3, and the migration is complete. You can proceed with cleanup tasks if needed.
Complete Command Sequence
Here's the complete sequence of commands in order:
# Check initial state
dfsrmig /getglobalstate
# Move to State 1
dfsrmig /setglobalstate 1
# Verify State 1
dfsrmig /getmigrationstate
# Move to State 2
dfsrmig /setglobalstate 2
# Verify State 2
dfsrmig /getmigrationstate
# Move to State 3 (final)
dfsrmig /setglobalstate 3
# Verify final state
dfsrmig /getmigrationstate
Important Best Practices
1. Always Check State Before Changing
Never skip the /getglobalstate or /getmigrationstate commands. Always verify the current state before advancing to the next one.
2. Wait for Completion
After setting a new state, wait for all servers to complete that state before moving to the next. This can take time depending on:
- Amount of data being replicated
- Network speed between servers
- Server performance
- Number of files and folders
3. Monitor Each State
Use /getmigrationstate frequently to monitor progress. Check for errors, warnings, or servers that aren't progressing correctly.
4. Test in Non-Production First
If possible, test the migration process in a non-production environment first. This helps you understand timing and identify potential issues.
5. Have a Rollback Plan
While migration states are generally one-way, have a plan for handling issues. This might include:
- Restoring from backups
- Documenting current configuration for restoration
- Understanding Microsoft support procedures for stuck migrations
Common Issues and Solutions
Servers Stuck in a State
If servers don't progress to the next state:
- Check event logs on affected servers
- Verify network connectivity between DFS servers
- Ensure all prerequisites are met
- Check for replication errors in DFS Management console
- Verify permissions on replication folders
Replication Errors
If you see replication errors during migration:
- Don't advance to the next state until errors are resolved
- Check disk space on all replication partners
- Verify folder paths are accessible
- Review DFS replication logs
- Ensure antivirus isn't blocking replication
State Verification Shows Errors
If /getmigrationstate shows errors:
- Address errors before proceeding
- Check each server individually if needed
- Review Microsoft documentation for specific error codes
- Consider Microsoft support for complex issues
Monitoring Migration Progress
Beyond the command-line tools, you can monitor migration progress using:
- DFS Management Console: Graphical interface showing replication status
- Event Viewer: DFS replication events and errors
- Performance Monitor: DFS replication performance counters
- DFS Replication Reports: Health reports and status summaries
Post-Migration Tasks
After reaching State 3 and verifying the migration is complete:
- Monitor replication for a period to ensure stability
- Verify data integrity across all replication partners
- Clean up old replication components if safe to do so
- Update documentation with new configuration
- Test access to DFS shares from client systems
- Verify backup processes work with new replication
When to Use This Process
Use this DFSR migration process when:
- Migrating from FRS to DFSR (legacy to modern replication)
- Consolidating DFS replication groups
- Reorganizing DFS topology
- Preparing for major infrastructure changes
- Moving to new server infrastructure
When Not to Use This Process
This process is specifically for DFS replication group migration. Don't use it for:
- Initial DFS replication setup (use DFS Management Console)
- Adding new replication partners (use standard DFS configuration)
- Changing replication schedules or filters (use DFS Management)
- Fixing replication errors (address the underlying issues first)
Conclusion
DFSR migration using dfsrmig commands is a structured process that must be followed carefully. The key to success is:
- Always check the current state before changing it
- Verify each state completes successfully before advancing
- Monitor progress closely at each step
- Have backups and a rollback plan
- Allow adequate time for each state to complete
Following this step-by-step process ensures your DFS replication migration completes successfully with minimal risk to your data and services.
Need Help with This Process?
If you need help with this migration, or if this is out of your scope to complete, we're here to help. Contact us through our contact page at nhmohio.com and we'll be happy to assist with any project, including DFSR migrations, domain controller migrations, and other infrastructure projects.
Related Articles:
← Automated Server Updates: Why I Use This Cron Setup on All My Servers