Migrating DHCP from Windows 2000 Server to Windows Server 2008

Getting your infrastructure running like a finely tuned engine is no easy feat; it takes blood, sweat, and tears, not to mention hundred, if not thousands, of hours of configuring, tweaking, and adjusting. So, if your organization decides to move to a Windows Server 2008-based infrastructure, how will you make the change as easy as possible?
Starting all over again just to move to a new server operating system is something to avoid if you can. Microsoft understands this concern and realizes that the easier it is to migrate to a newer version of Windows, the more likely organizations are to make the move.
While there are many things that merit consideration when moving from a Windows 2000 Server- or Windows Server 2003-based network to a Windows Server 2008-based network, there is one important service that will make or break your migration: DHCP. If you blow it, everyone will know it!
DHCP is one of two foundational network services that govern how your network operates; the other is DNS. Migrating a Windows 2000 Server/Windows Server 2003 DNS database to Windows Server 2008 is a simple process, sometimes requiring nothing more than a configuration change to DNS; at its most complex, it requires the completion of a zone transfer between the old and new servers to migrate DNS information. DHCP, on the other hand, has no built-in mechanism to easily transfer its database information from one server to another. But with a little bit of work, it doesn’t require too much effort to migrate your DHCP services from your Windows 2000 Server/Windows Server 2003 to Windows Server 2008.
There are different steps depending on whether you’re moving DHCP from Windows 2000 Server or Windows Server 2003. Here are descriptions of both processes.

Migrating DHCP from Windows 2000 Server to Windows Server 2008

The process to migrate your Windows 2000 Server DHCP database to Windows Server 2008 requires a two-step strategy. First, you’ll export the DHCP settings from your old Windows server. Then, you’ll import those settings into the server that’s running Windows Server 2008. You should be prepared to spend about 15-20 minutes performing the procedure, assuming that you already have Windows Server 2008 installed and configured ahead of time. It’s also assumed that you’ve installed the DHCP role on the Windows Server 2008 computer.
On the old server: Moving the settings out
Migrating the DHCP database settings off of your old Windows server is a fairly simple task. You’ll need to disable the DHCP service on the old Windows server so that it cannot be started again. To do this, you’ll use the Services console in the Administrative Tools folder. Double-click the DHCP Server item and select Disabled, as shown in Figure A.

Figure A

Disable the DHCP service on the Windows 2000 Server.
After disabling the service, stop the currently running DHCP service; either click the Stop button shown in Figure A or issue the net stop dhcpserver command from the command line. After disabling and stopping the running DHCP service, all that remains to be done on the legacy Windows server is to export the DHCP database information so that it can be transferred to the Windows Server 2008 computer.
You can do this using the Registry Editor (regedt32). Save the appropriate key to another location, such as a networked drive that is accessible to both the Windows 2000 Server and the server running Windows Server 2003. Open the Registry Editor and navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ DhcpServer\Configuration key.
Once there, click the Registry menu and select Save Key, as shown in Figure B. Save the key with a name that you will recognize, such as config.key.

Figure B


You can save the key here.
You’ll need to copy the entire contents of the %SystemRoot%\System32\Dhcp folder (Figure C) to another location, preferably the same network drive where you placed the configuration key previously. Now it’s time to move to the server that’s running Windows Server 2008.

Figure C

Export the Configuration key to migrate the Windows 2000 DHCP server settings.
On the new server: Moving the settings in
To migrate your DHCP configuration to Windows Server 2008, you’ll need to have already installed the DHCP Server service on the computer. If you have not done so, you can do this from the Server Manager available on the Start menu.
Once the DHCP service is installed, you’ll need to stop it so you can import the DHCP configuration. To do so, from a command prompt, issue the command net stop dhcpserver. Now you’re ready to import the DHCP configuration into Windows Server 2008.
First, import the registry key that you previously exported. On the server that’s running Windows Server 2008, double-click the registry file that you exported earlier. When asked to verify the operation, choose Yes.
The next step you’ll need to complete is the transfer of the %SystemRoot%\System32\Dhcp folder contents. Navigate to this location and delete all contents in the folder, including all subfolders and their contents. Copy the information into this folder that was previously taken from the Windows 2000 Server’s DHCP folder.
After you complete this step, you can begin putting your new Windows Server 2003 DHCP server in operation. You’ll need to start the DHCP Server service by issuing net start dhcpserver from a command prompt. You should receive the confirmation dialog box shown in Figure D.

Figure D

Start DHCP after you copy the old files.

Migrating DHCP from Windows Server 2003 to Windows Server 2008

Migrating DHCP from Windows Server 2003 to Windows Server 2008 is easier than migrating from earlier versions of Windows. This procedure assumes that the existing DHCP server is running on Windows Server 2003 and that you’ve already installed the DHCP server role on your Windows Server 2008 server. (Note: IPv6 DHCP capability is not discussed in this column.)
Follow these steps:
  1. Start a command prompt on the Windows Server 2003 DHCP server.
  2. At the prompt, type netsh dhcp server export C:\w2k3-dhcp.txt all.
  3. Copy w2k3-dhcp.txt to the root of the C: volume on your new server.
  4. On the new Windows Server 2008 DHCP server, start a command prompt.
  5. At the prompt, type netsh dhcp server import c:\dhcpdatabase.txt all.
  6. Start the DHCP administrative console and verify that your scopes and configurations made their way to your new server.

Post migration

Once the migration is complete, you’ll need to do some tidying up within the DHCP console. Open the DHCP console from the Administrative Tools folder and reconcile all scopes by clicking Action | Reconcile All Scopes. If any leases are found that need to be reconciled, click Reconcile to synchronize the DHCP Registry and Active Directory settings.
Verify that your DHCP server is operating properly by opening the DHCP console and checking your configuration, as shown in Figure E.

Figure E

Once the scope shows the Status is Active, all is well.
Note: Editing the registry is risky, so be sure you have a verified backup before saving any changes

Know To Install and configure a DHCP server in Windows Server 2008

Dynamic Host Configuration Protocol (DHCP) is an invaluable service when you have a network larger than a handful of computers. It’s also a standard component of enterprise networks and sub networks. Microsoft Windows Server 2008’s built-in DHCP server allows Windows machines (and any other TCP/IP-based machines and devices) to obtain their IP addresses and network settings automatically, which can vastly simplify network configuration. In this document, we’ll discuss how to install and configure a DHCP server in Windows Server 2008, and we’ll explore some of the advanced features DHCP has to offer.

Create a plan

Before you configure your DHCP server, it is a good idea to have all your ducks in a row. Prepare and have all the necessary information up front before sitting down and configuring your server. For example, you may need to know:
  • The scope of IP addresses that your server will manage (e.g., 192.168.1.50 to 192.168.1.200).
  • Which machines require static IP addresses (i.e., those machines such as servers and routers that will not use DHCP to receive their IP addresses but will be set manually).
  • Which network information you want to send out to DHCP clients when they get their IP addresses (e.g., the addresses for your default gateway, DNS servers, and WINS servers).
It is much easier to configure your DHCP server with this information in hand rather than scrambling for it at implementation time.

Installing DHCP

Installing a DHCP server in Windows 2008 is a snap. They created a very simple wizard that walks you through the entire process. Follow me on this journey.
To install a DHCP server from the Control Panel, follow these steps:
  1. From the Start menu, select | Control Panel | Administrative Tools | Server Manager.
  2. Expand and click Roles (Figure 1).
  3. Choose Add Roles and follow the wizard by selecting the DHCP role (Figure 2).
  4. A new DHCP wizard appears to help you configure a DHCP server.

Figure1

Server Manager

Figure2

Add Roles Wizard
In the previous release of Windows, a wizard did not appear to walk you through creating a DHCP server. Windows Server 2008 has really simplified this process by allowing you to configure a DHCP server in roughly seven steps. Of course, you can still manage your DHCP server from the DHCP Microsoft Management Console (MMC) snap-in or delete and create scopes on the fly.
Let’s continue on through the wizard. Your network cards and static IP addresses are automatically detected and you can choose how DHCP will service clients on different subnets, as shown in Figure 3.

Figure3

Choose your static IP addresses to service DHCP clients
On the next window (Figure 4), you can specify the applicable DNS server(s) to be used with DHCP when an address is assigned. Figure 5 displays where you would enter the applicable WINS servers if you require it on your network.

Figure4

Enter your DNS server IP address

Figure5

Enter your WINS server IP address

About scopes

When you create a scope, you must select the range of IP addresses and you must specify the appropriate scope options to include. These options are what we were referring to above when we mentioned that you can assign other network information to your clients at the time they are given an IP address.
There are two types of scope options: Global and Scope. Global options are propagated to all the scopes that you create on that DHCP server, while Scope options are only for the individual scope that you are working with.
For example, if you have different scopes for several different subnets and each subnet will have a different default gateway but will share the same DNS servers, you would want to set the DNS servers as a Global option while the default gateways would be set separately in each scope as a Scope option.
On the DHCP scope window, you will create your scope. Depending on the size of your network and the amount of users that will be assigned IP addresses, some thought must be given to the parameters of your scope selections. In my example (Figure 6), I created a simple scope.

Figure6

Creating your scope
The subnet type dropdown allows you to choose wireless as well (Figure 7). It defaults to 24 hours. If you want to activate the scope when the wizard is complete, click the Activate this scope checkbox. If you leave it empty, you must activate the scope in the DHCP Microsoft Management Console (MMC) snap-in.

Figure7

You can add multiple scopes before continuing the wizard
With Windows Server 2008, if you have a router (Figure 8) that supports and is configured to take advantage of IPv6, you can enable this functionality on your network.

Figure8

Enable IPv6 stateless mode

Authorizing the DHCP server and activating scopes

In previous versions of Windows Server, you had to install and configure your DHCP server and then authorize it in the DHCP MMC snap-in. Authorizing your DHCP server allows you to prevent hackers from configuring rogue DHCP servers. In Windows Server 2008, you have the ability to either authorize the server in the Wizard or authorize it after the fact in the DHCP MMC-snap-in (Figure 9).

Figure9

Authorizing your DHCP server
You are now ready to review (Figure 10) and confirm your settings before applying your DHCP settings (Figure 11).

Figure10

Reviewing your DHCP configuration before applying

Figure11

DHCP installation in progress
Once you have installed the DCHP server, you can manage it from the DHCP MMC snap-in (Figure 12) located in Administrative tools. On this screen you can create additional exclusions and reservations.

Adding reservations

In addition to specifying exclusions, you can add reservations to your DHCP server. By adding a reservation, you ensure that a machine always receives the same IP address from the DHCP server.
  1. Right-click on Reservations and choose new reservation.
  2. Enter a friendly name for the reservation and the IP address you want to assign to the computer or device.
  3. Enter the MAC address of the computer or device. (For Windows machines, you can find the MAC address by running ipconfig/all from the command prompt of the machine.)
  4. Enter a description and then choose the following reservation type: DHCP, BOOTP (going across a router), or both, as shown in Figure 12. Click Add.

Figure12

Adding a reservation

Adding exclusions

In addition to specifying reservations, you can add exclusions to your DHCP server (Figure 13). By adding exclusions, you ensure that machines never receive a DHCP lease for that range of IP addresses. This is very useful to block IP addresses for your servers and routers.

Figure13


Adding an exclusion
In order to add Exclusions, right-click on Address Pools and choose New Exclusion Range as shown in Figure 14 and Figure 15.

Figure14

IP address Exclusion range

Figure15

DCHP MMC snap-in

Troubleshooting DHCP

After configuring DHCP, the easiest way to troubleshoot it is to use Ipconfig from a command prompt. To view all TCP/IP information on a machine just type ipconfig/all. To release a DHCP lease, type ipconfig/release; to renew a lease, type ipconfig/renew.