Migrate DHCP server to Windows Server | ·续

The Import-SmigServerSetting cmdlet requires you to map the source physical address to the destination physical address.

Note

The destination server can be assigned the same static IP address as the source server, unless other roles on the source server must continue to run on it. In that case, the static IP address of the destination server can be any unallocated static IP address in the same subnet as the source server.

  1. On the source server, run the Export-SmigServerSetting cmdlet, where <storepath> is the path that contains the Svrmig.mig file after this step is completed. An example of the path is \fileserver\users\username\dhcpstore.

Export-SmigServerSetting -featureID DHCP -User All -Group -IPConfig -path <storepath> -Verbose

  1. On the source server, delete the DHCP authorization for the source DHCP server by running the following command, where Server FQDN is the fully qualified domain name (FQDN) of the DHCP server and Server IPAddress is the IP address of the server. The command parameters are case-sensitive and must appear exactly as shown.

Netsh DHCP delete server <Server FQDN> <Server IPAddress>

Complete the migration on the destination server

Return to the destination server and follow these steps to complete the migration.

  1. Before you use the Import-SmigServerSetting cmdlet to import the DHCP server settings, be aware of the following conditions:

  2. You can either use a single command line with all the parameters to import DHCP settings (as when you export data from the source server) or you can use the cmdlet multiple times to import data one parameter at a time.

  3. If you decide to run the Import-SmigServerSetting cmdlet separately to import the IP settings, use the source IPSettings.txt file, referred to in step 3 of the previous procedure. You map the source physical addresses to the destination physical addresses in step 3 of this procedure. If you plan to import role and IP settings separately, you should import IP settings first to avoid any IP conflicts. You can then import the DHCP role.

  4. If the DHCP Administrators group includes local users, then use the -Users parameter combined with the -Group parameter to import local users into the DHCP Administrators group. If it only contains domain users, then use only the -Group parameter.

Note

If the source server is a domain member server, but the destination server is a domain controller, imported local users are elevated to domain users, and imported local groups become Domain Local groups on the destination server.

  • If the DHCP Server role that you're migrating hasn't been installed on the destination server, the Import-SmigServerSetting cmdlet installs that DHCP Server role and its dependencies. You might have to restart the destination computer to complete the installation after the DHCP Server role is installed by the cmdlet. Then, to complete the import operation after you restart the computer you must run the Import-SmigServerSetting cmdlet again along with the -Force parameter.

  • On the destination server, run the following command, where <storepath> is the available path that contains the Svrmig.mig file, <SourcePhysicalAddress-1> and <SourcePhysicalAddress-2> are comma-separated lists of the physical addresses of the source network adapter, and <TargetPhysicalAddress-1> and <TargetPhysicalAddress-2> are comma-separated lists of the physical addresses of the destination network adapter:


Import-SmigServerSetting -FeatureID 'DHCP' -User All -Group -IPConfig <All | Global | NIC>

-SourcePhysicalAddress <SourcePhysicalAddress-1>,<SourcePhysicalAddress-2>

-TargetPhysicalAddress <TargetPhysicalAddress-1>,<TargetPhysicalAddress-2>

-Force -Path <storepath> -Verbose

The -IPConfig switch should be used with the value All in case the user wants to import all source settings.

Important

If you import the source server IP address to the target server together with the DHCP role without disconnecting or changing the IP address of the source server, an IP address conflict will occur.

  1. Run the following command to start the DHCP service: Start-Service -Name "DHCPServer"

  2. Authorize the destination server. Command parameters are case-sensitive and must appear exactly as shown. On the destination server, run the following command where Server FQDN is the FQDN of the DHCP Server and Server IPAddress is the IP address of the server:


netsh DHCP add server <Server FQDN> <Server IPAddress>

When this migration is finished, client computers on the network server are served by the new x64-based destination server running Windows Server. The migration is complete when the destination server is ready to serve IP addresses to the network.

Verify the migration

When all the migration steps are complete, you can use the following procedure to verify that the DHCP server role migration was successful. If the migration failed, you can return to the previous valid configuration by following the steps in Post-Migration Tasks.

Verify the configuration of the destination server

Follow these steps to confirm that the DHCP destination server is now serving the domain.

  1. Make sure that the destination server is authorized by running the following command in a Windows PowerShell window:

netsh DHCP show server

The output of this command must contain the name of the DHCP destination server.

  1. Check whether DHCP server is running on the destination server. In Task Manager, on the Services tab, the DHCP server status should be Started. You also use Task Manager to confirm that the status of the source server is Stopped.

  2. Verify that the client computers are correctly receiving IP addresses on request by running the following commands at a command prompt on a client computer:


ipconfig /release

ipconfig /renew

If the IP address of the DHCP server hasn't changed, you don't have to run the ipconfig /release command. Running ipconfig /renew should be sufficient.

The output of these commands should show that the client computer was issued an IP address.

  1. Use the DHCP console to verify that the scopes and other settings were migrated. To connect to the destination server, select Action, select Add Server, and then type the IP address or host name of the DHCP server. In the console tree, expand the server node, and then expand the IPv4 and IPv6 nodes to confirm that the scopes have been migrated. Then locate the folders for the scopes and view the address range, reservations, scope options, and active leases to verify the same. You can also go to the Server Options folder and verify the migrated server options.

Post-migration tasks

These post-migration tasks for the source server are optional, depending on your migration scenario.

Migration is complete after you verify that the destination server, not the source server, is now serving the network.

Retire DHCP on your source server

After you verify the migration, you can disconnect, repurpose, or retire the source server. If the source server is running other server roles, it should be left on the network. If you don't have to use this computer, you can store it as a backup in case you ever have to revert to your previous DHCP configuration.

If your migration scenario includes a standalone DHCP Server, then this source server was taken offline after the export file was created. In this scenario, the DHCP service was interrupted from the time that it was stopped until the migration was complete on the new server.

If your migration scenario includes more than one DHCP Server in a domain, a backup or other DHCP server continues to serve IP addresses during the migration so that services to clients are never interrupted. The migration is complete on the new server when the IP address of the source server is migrated to the destination server.

Retire your source server

After you confirm that the destination server is performing the functions previously handled by the source server, you can retire or repurpose the source server, depending on your needs. Follow your organization’s policy regarding server decommissioning. For information about decommissioning a domain controller, see Demoting domain controllers and domains.

Restore DHCP if migration fails

If the migration of DHCP Server fails, you have these options:

  • If the source server hasn't been repurposed, an administrator can reassign the IP configuration settings, reauthorize the server, and restart the DHCP service on the original server.

  • Use the backup files that were created on the source server, to restore DHCP server on the original DHCP server.

Troubleshoot cmdlet-based migration

The Windows Server Migration Tools deployment log file is located at %windir%\Logs\SmigDeploy.log. Other Windows Server Migration Tools log files are created at the following locations.

  • %windir%\Logs\ServerMigration.log

  • %localappdata%\SvrMig\Log

If migration log files can't be created in the previous locations, ServerMigration.log and SmigDeploy.log are created in %temp%, and other logs are created in %windir%\System32.

For DHCP-specific troubleshooting tips, see Troubleshoot problems on DHCP servers.

If connections between either the source or destination servers and the domain controllers or global catalog servers can't be restored

  1. Before you run Export-SmigServerSetting, Import-SmigServerSetting or Get-SmigServerFeature again, remove all unresolved domain users or groups who are members of local groups from the server on which you're running the cmdlet.

  2. Before you run Send-SmigServerData or Receive-SmigServerData again, remove all unresolved domain users or groups who have user rights to files, folders, or shares on the migration source server.

View the content of Windows Server Migration Tools result objects

All Windows Server Migration Tools cmdlets return results as objects. You can save result objects, and query them for more information about settings and data that were migrated. You can also use result objects as input for other Windows PowerShell commands and scripts.

Result object descriptions

The Windows Server Migration Tools Import-SmigServerSetting and Export-SmigServerSetting cmdlets return results in a list of MigrationResult objects. Each MigrationResult object contains information about the data or setting that the cmdlet processes, the result of the operation, and any related error or warning messages. The following table describes the properties of a MigrationResult object.

| Property name | Type | Definition |

| --- | --- | --- |

| ItemType | Enum | The type of item being migrated. Values include General, WindowsFeatureInstallation, WindowsFeature, and OSSetting. |

| ID | String | The ID of the migrated item. Examples of values include Local User, Local Group, and DHCP. |

| Success | Boolean | The value True is displayed if migration was successful; otherwise, False is displayed. |

| DetailsList | List<MigrationResultDetails> | A list of MigrationResultDetails objects. |

Send-SmigServerData and Receive-SmigServerData cmdlets return results in a list of MigrationDataResult objects. Each MigrationDataResult object contains information about the data or share that the cmdlet processes, the result of the operation, any error or warning messages, and other related information. The following table describes the properties of a MigrationDataResult object.

| Property name | Type | Definition |

| --- | --- | --- |

| ItemType | Enum | The type of migrated item. Values include File, Folder, Share, and Encrypted File. |

| SourceLocation | String | The source location of the item, shown as a path. |

| DestinationLocation | String | The destination location of the item, shown as a path. |

| Success | Boolean | The value True is displayed if migration was successful; otherwise, False is displayed. |

| Size | Integer | The item size, in bytes. |

| ErrorDetails | List<MigrationResultDetails> | A list of MigrationResultDetails objects. |

| Error | Enum | Errors enumeration for errors that occurred. |

| WarningMessageList | List<String> | A list of warning messages. |

The following table describes the properties of objects within the MigrationResultDetails object that are common to both MigrationResult and MigrationDataResult objects.

| Property name | Type | Definition |

| --- | --- | --- |

| FeatureId | String | The name of the migration setting that is related to the item. Examples of values include IPConfig and DNS. This property is empty for data migration. |

| Messages | List<String> | A list of detailed event messages. |

| DetailCode | Integer | The error or warning code associated with each event message. |

| Severity | Enum | The severity of an event, if events occurred. Examples of values include Information, Error, and Warning. |

| Title | String | Title of the result object. Examples of values include the network adapter physical address for IP configuration, or user name for local user migration. |