Migrate or duplicate DHCP role in Windows Domain


To totally unlock this section you need to Log-in


Login
If you have ever had to move a DHCP Server from one physical server to another, you know that the process isn’t exactly fun or intuitive if the servers are running Windows Server 2003. Fortunately, when Microsoft created Windows Server 2008, they completely redesigned the administrative interface, and in doing so, also made DHCP much easier to migrate.

Migration in Windows Server 2003

To migrate a Windows 2003 DHCP Server, the first thing that you must do is to stop, and then disable the DHCP service. Of course this means that clients will not be able to use the DHCP server to obtain IP addresses until the process is complete.

You must then copy the server’s \%systemroot%\system32\DHCP folder to a safe location that you can use later on. After doing so, you should remove this folder from the original server.

Next, you will have to do some work through the Registry Editor (regedit.exe). As always, when you are working with the Registry Editor, you should make a backup first, because making an incorrect change can destroy Windows. With that said, navigate through the Registry Editor to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration

Now, choose the Save Key command from the editor’s Registry menu, and export the registry key to a safe location. When you are done, you can uninstall the Add/Remove Windows Components Wizard to uninstall the DHCP server component.

Restoring a DHCP Server Backup in Windows Server 2003

Before you can restore your DHCP server backup, you must install the DHCP server component onto the new server, but after doing so, you must stop and temporarily disable the DHCP service. Now, check the backup directory that you created earlier for a file named system.mdb. If this file exists, rename it to system.src. You may now copy all of the files from the backup directory to the new server’s %systemroot%\system32\DHCP folder.

Now you have to restore the backup copy of the registry that you created earlier. To do so, open the Registry Editor and navigate through the registry tree to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration

Choose the Restore command from the editor’s Registry menu, and then restore the registry backup file that you created earlier. When you are done, close the Registry Editor, reboot the machine, and then enable and start the DHCP service.

Migration in Windows Server 2008

As you can see, moving the DHCP service from one server to another in Windows Server 2003 was a real pain. Fortunately, the process is a lot easier in Windows Server 2008. Begin the process by opening the DHCP Manager (even through mmc.exe, choosing the DHCP snap-in), found on the server’s Administrative Tools menu. When the console opens, right click on the server name, and then choose the Backup command from the resulting shortcut menu, as shown in Figure A.

Migrate or duplicate DHCP role in Windows Domain

Migrate or duplicate DHCP role in Windows Domain - Figure A

When you do, Windows will prompt you to enter a location for the backup file that you are creating. After entering a location, click OK, and the backup file will be created.

Restoring a DHCP Backup in Windows Server 2008

Microsoft makes restoring a backup just as easy. To do so, just open the DHCP management console, right click on the server that you want to restore the backup to, and choose the Restore command from the resulting shortcut menu. You can see the Restore option shown in Figure A.

Now, just specify the location of the backup that you want to restore, and click OK. Windows will now ask you if it is OK to stop and restart the DHCP Server service, as shown in Figure B. Click Yes, and the restore will begin. When the process completes, the DHCP Server service should automatically restart with the new settings.

Migrate or duplicate DHCP role in Windows Domain

Migrate or duplicate DHCP role in Windows Domain - Figure B

Export the DHCP database on Microsoft Windows Server 2003 or Windows Server 2008

To move a DHCP database and configuration from a server that is running Windows Server 2003 or Windows Server 2008 to another server that is running Windows Server 2008:

1. Log on to the source DHCP server by using an account that is a member of the local Administrators group.

2. Click Start, click Run, type cmd in the Open box, and then click OK.

3. Type (and then press ENTER):

netsh dhcp server export C:\dhcp.txt all

NOTE: You must have local administrator permissions to export the data.

Import the DHCP database on Microsoft Windows Server 2003 or Windows Server 2008

1. Log on as a user who is an explicit member of the local Administrators group. A user account in a group that is a member of the local Administrators group will not work. If a local Administrator account does not exist for the domain controller, restart the computer in Directory Services Restore Mode, and use the administrator account to import the database as described later in this section.

2. Copy the exported DHCP database file to the local hard disk of the Windows Server 2008-based computer.

3. Verify that the DHCP service is started on the Windows Server 2008-based computer.

4. Click Start, click Run, type cmd in the Open box, and then click OK.

5. At the command prompt, type (and then press ENTER, where c:\dhcpdatabase.txt is the full path and file name of the database file that you copied to the server):

netsh dhcp server import c:\dhcpdatabase.txt all

NOTE: when you try to export a DHCP database from a Windows 2000/2003 domain controller to a Windows Server 2008 member server of the domain, you may receive the following error message:

Error initializing and reading the service configuration - Access Denied

NOTE: You must have local administrator role to import the data.

Authorize the DHCP server

1. Click Start, point to All Programs, point to Administrative Tools, and then click DHCP.

NOTE: you must be logged on to the server by using an account that is a member of the Administrators group. In an Active Directory domain, you must be logged on to the server by using an account that is a member of the Enterprise Administrators group.

2. In the console tree of the DHCP snap-in, expand the new DHCP server. If there is a red arrow in the lower-right corner of the server object, the server has not yet been authorized.

3. Right-click the server object, and then click Authorize.

4. After several moments, right-click the server again, and then click Refresh. A green arrow indicates that the DHCP server is authorized.

Reset the Local Administrator password on a Domain Controller

To reset the local Administrator password on a Domain Controller, using Directory Services Restore Mode, you'll have to read here.