Migrate DHCP server to Windows Server | Microsoft Learn

DHCP server migration involves moving the settings for your existing DHCP server to a new DHCP server on the network. The goal of this server migration is to install the DHCP server role on the Windows Server operating system so that it provides DHCP leases on a network without any perceptible change to DHCP client computers.

This guide describes the steps for migrating existing DHCP server settings to a server that is running Windows Server. By using this guide to migrate a DHCP server, you can simplify migration, reduce migration time, increase the accuracy of the migration process, and help eliminate possible conflicts that might otherwise occur during DHCP migration. This guide doesn't contain instructions for migration when the source server is running multiple roles. If your server is running multiple roles, we recommend that you design a custom migration procedure specific to your server environment. Some notes about migration:

  • Migrations between physical operating systems and virtual operating systems are supported.

  • Migration from a source server to a destination server that is running an operating system in a different system user interface (UI) language than the source server isn't supported.

  • Migration is recommended instead of an upgrade even when the hardware is native x64-based.

This guide is intended for IT administrators, IT professionals, and other knowledge workers who are responsible for the operation and deployment of DHCP servers in a managed environment. The server administrator can choose which components of an existing installation to migrate. Together with the server role, these components usually include configuration, data, system identity, and operating system settings.

Prerequisites

  • An existing DHCP server that is set up and running

  • The following permissions are required on the source server and the destination server:

  • Domain administrative rights that are required to authorize DHCP Server.

  • Local administrative rights are required to install or manage DHCP Server.

  • Write permissions are required to the migration store location.

Server migration process

DHCP Server migration is divided into the following major sections:

  • Prepare to migrate: The premigration process involves the manual collection of data, followed by steps to prepare the destination and source servers.

  • Migrate the DHCP Server Role: The migration process includes source and destination server procedures that use the Export and Import cmdlets to automatically collect, store, and then migrate server role settings.

  • Verify the migration: Confirm that the destination server successfully replaced the source server.

  • Complete post-migration tasks: Retire, or repurpose the source server. Troubleshoot the migration if it failed, and roll back if needed.

Diagram showing the server migration process, showing premigration, migration, and post-migration steps.

Prepare to migrate

  • Identify your DHCP Server source and destination servers.

  • Determine the domain, server name, and passwords on the source server. To identify the domain of the original server, view System Settings from the Control Panel.

  • Before migration, install all critical updates and service packs on the source server. It's a recommended best practice that all current critical updates and service packs are installed on both the source and the destination servers.

  • Count the number of network adapters in the source and destination servers and make sure that they're equal in number. If the source server that is running DHCP Server has multiple network adapters and the DHCP Server service is bound to all and serving IP addresses on different subnets, the destination server that is running DHCP Server must also have multiple network adapters so that it can serve the same subnets as on the source server.

  • Prepare a migration store file location. The store location must be accessible from the source server during the export and from the destination server during the import. Use a common drive that can contain all DHCP Server–related information from the source server. The storage location should be similar to the following: \fileserver\users\username.

Install migration tools

If you haven't already done so, install Windows Server Migration Tools on the destination and source servers. The migration tools can be installed either using PowerShell or Server Manager.

For PowerShell, use the Install-WindowsFeature cmdlet:


Install-WindowsFeature -Name Migration -ComputerName Server1

Use Server Manager, and open the Add Roles and Features Wizard. Find and install the feature: Windows Server Migration Tools.

Prepare the destination server

To install DHCP Server on the destination server, complete the menu-driven installation process. Complete the following procedure to prepare the destination server.

To prepare the destination server

  1. Install Windows Server and configure the destination server.

  2. Make sure that there's sufficient disk space to store the DHCP Server database. The disk space needed varies with each installation and should be equal to or greater than the space for the DHCP Server database.

  3. Add the destination server as a member server in the domain of the source server that's being replaced.

  4. Verify that the destination server can resolve the names of domain users who are members of the local group during the import operation. If source and destination servers are in different domains, the destination server must be able to contact a global catalog server for the forest in which the source domain user accounts are located.

  5. On a computer that is running Windows Server, open Windows PowerShell as an administrator.

  6. Load the Server Manager module into your Windows PowerShell session. To load the Server Manager module, enter the command:


Import-Module -Name ServerManager

Note

It isn't mandatory that DHCP Server is installed on the destination server before you import the settings. If the role isn't installed on the destination server, it'll be installed automatically during the import process. However, because installation of the role during import might extend downtime, we recommend that you install DHCP Server by using the Server Manager console on the destination server as part of your preparation for the migration.

  1. On the destination server, to install the DHCP server, run the following command:

Install-WindowsFeature -Name DHCP

You can also install DHCP Server manually by using Server Manager. For more information, see Install and configure DHCP Server.

  1. By the end of the migration process, the destination server should have a static IP address. Although you won't change the destination server IP address now, consider the following scenarios in preparation for changing it when migration is complete.

  2. If your migration scenario requires that you decommission and disconnect the source server from the network, only then can you make the IP address on the destination server the same as the IP address on the source server. The source server must be disconnected from the network or shut down so that there's no IP address conflict between the source server and destination server. However, the destination server can still serve clients that are searching for the legacy (source) server that was running DHCP Server.

  3. If your migration scenario calls for continuing to run the source server on the network for other, non-DHCP purposes, you have to assign the destination server an unallocated IP address in the same subnet as the source server to avoid IP conflicts.

  4. DHCP Server clients that attempt to renew an IP address lease send the renew request to the previous IP address of the DHCP server. If the source server has been decommissioned and then disconnected from the network and the new DHCP destination server is operating with a different IP address, this request initially fails because of the changed IP address. However, clients try to rediscover the IP address of the DHCP server on the network and therefore recover from this transient failure.

Warning

If the source server is running multiple roles, renaming the source server or changing its IP address can cause other roles that are running on the source server to fail.

  1. If the DHCP Server database path doesn't match the default path, you must ensure that the destination server has a disk with the same drive letter as seen in source server’s DHCP Server database path.

The destination server is now prepared for migration.

Prepare the source server

Follow these steps to prepare the source server for migration.

  1. Back up the source server. The backup should be a DHCP Server-specific backup, not a Windows backup. (A Windows backup backs up the complete operating system.) You can create the DHCP Server-specific backup by using the Netsh command-line tool or Microsoft Management Console (MMC).

  2. If it's running, stop the DHCP Server service. In a session that was opened as described in step 5 of prepare the destination server, enter:


Stop-Service -Name "DHCPserver"

  1. If the DHCP Server database path doesn't match the default path, make sure that the destination server has a disk with the same drive letter as in source server’s DHCP Server database path.

You're now ready to begin DHCP Server migration.

Migrate the DHCP Server Role

In this section, you'll migrate the DHCP Server to the destination server from the source server. Membership in Domain Administrators or equivalent is the minimum required to complete these procedures.

Migrate DHCP Server to the destination server

  1. If it isn't already installed, install DHCP Server on the destination server.

  2. If it's running, stop the DHCP Server service by running the following command:


Stop-Service -Name "DHCPserver"

Migrate DHCP Server from the source server

Follow the steps in this section to migrate DHCP Server from the source server.

Important

Before you run the Import-SmigServerSetting, Export-SmigServerSetting, or Get-SmigServerFeature cmdlets, verify that during migration, both source and destination servers can contact the domain controller that's associated with domain users or groups who are members of local groups on the source server. Before you run the Send-SmigServerData or Receive-SmigServerData cmdlets, verify that during migration, both source and destination servers can contact the domain controller that's associated with those domain users who own files or shares that are being migrated.

  1. On a computer that's running Windows Server, open Windows PowerShell as an administrator.

  2. Load Windows Server Migration Tools into your session.

If you opened the current session by using the Windows Server Migration Tools shortcut on the Start menu, skip this step, and go to step 3. Only load the Windows Server Migration Tools snap-in in a session that was opened by using some other method, and into which the snap-in hasn't already been loaded. To load Windows Server Migration Tools, type the following, and then press Enter.


Add-PSSnapin Microsoft.Windows.ServerManager.Migration

  1. Collect data from the source server by running the Export-SmigServerSetting cmdlet as an administrator. The Export-SmigServerSetting cmdlet parameters can collect all source DHCP server data in a single file (Svrmig.mig). Or, the Export-SmigServerSetting cmdlet can be run multiple times, with each iteration using one or more parameters to collect and store data in multiple Svrmig.mig files. Before you run this command, review the following:

  2. When you run the command in step 4, you're prompted to provide a password to encrypt the migration store data. You must provide this same password to import from the migration store.

  3. The path parameter can be an empty or nonempty directory. The actual data file in the directory (Svrmig.mig) is created by the Export-SmigServerSetting cmdlet. Therefore, the user doesn't have to specify a file name.

  4. If the path isn't a shared location that the destination server can read from, you must manually copy the migration store to the destination server or a location that the destination server can access.

  5. If a migration store location already exists and you want to rerun the Export-SmigServerSetting cmdlet, you must move the Svrmig.mig file from that location and store it elsewhere, rename or first delete the migration store.

  6. You can perform both IP and DHCP Server migration at the same time from a Windows PowerShell prompt by using the Export-SmigServerSetting cmdlet combined with the IPConfig switch, on a single command line.

  7. Extra command line parameter information:

  8. -Users and -Group parameters

The -Users parameter must be specified only if the DHCP Administrators group includes local users. Otherwise, you can use the -Group parameter and all members of DHCP administrators will be migrated. Administrator group members can include domain users.

Important

If the source server is a domain controller, but the destination server isn't, Domain Local groups are migrated as local groups, and domain users are migrated as local users.

  • The -IPConfig parameter collects IP information when it's used with the Export-SmigServerSetting cmdlet on the source server; the -IPConfig parameter applies settings when the Import-SmigServerSetting cmdlet is used on the destination server.

If the source DHCP Server has multiple network adapters and the DHCP server service is bound to more than one network adapter and serving IP addresses on different subnets, the destination DHCP Server must also have multiple network adapters so that it can serve the same subnets as the source DHCP Server. Because IP configuration details will be used later when importing IP configuration settings to the destination server, it's a best practice to save the IP configuration settings by using the following command: IPConfig /all > IPSettings.txt.