Articles and news

Microsoft Windows Articles and News
Welcome to Articles and news Sign in | Join | Help
in Search

Using DHCPEXIM and netsh to migrate DHCP scopes to a Windows 2003 Server DHCP server



DHCP in Windows Server is one of those little thought about services that do not get much attention unless you are setting up a new DHCP server, configuring a DHCP scope, or migrating to another physical server.

 So just how do you go about migrating a Server or Scope from Windows NT Server, Windows 2000 Server or Windows 2003 server to a new Windows 2003 Server? The tools used and procedure depends on what version of Windows you are migrating from.

If you are Migrating from either Windows NT Server 4.0 or Windows 2000 Server DHCPEXIM is used for the export and netsh used for the import into Windows  Server 2003 where as if you are going from Windows Server 2003 to Windows Server 2003 netsh is used for both the export and import.

The entire procedure involves the following steps:

·         Compact the DHCP Database (Only required for Windows NT and Windows 2000)

·         Export DHCP Database & DHCP Configuration (Windows NT 4.0 and 2000 Server DHCPEXIM) ( Windows  Server 2003 netsh)

·         Import DHCP Configuration and Database into Windows Server 2003 (Use Netsh) 

 

Compact the DHCP Database

 

This first step is only required for Windows NT 4.0 and Windows 2000 Server and is outlined below:

 

1.       You first need to stop the DHCP Server Service this can be achieved by running the following command from the command prompt.  (Start Run CMD Press enter)

Net stop dhcpserver  <press enter>

 

2.       This second step involves running the jetpack command against your DHCP Database, open a command prompt (Start Run CMD Press enter) and run the following commands

Cd %systemroot%\system32\dhcp     <press enter>

Jetpack dhcp.mdb TempFileName.mdb <press enter>

 

 

Figure 1: Compacting the DHCP.mdb Database

 

Export the DHCP Database

 

This part is broken down into two sections Exporting the DHCP Database from Windows NT 4.0/ Windows 2000 Server and Exporting the DHCP Database from Windows Server 2003

 

Exporting the DHCP Database from NT 4.0 and Windows 2000 Server

 

In the entire process of migrating a DHCP server the export of the DHCP Database for both NT 4.0 and Windows 2000 Server requires use of the Server Resource Kit tool DHCPEXIM, DHCPEXIM is also available as a separate download from the following URL:

http://support.microsoft.com/kb/927229

First begin by downloading and installing DHCPEXIM.

 

Once installed run DHCPEXIM.exe from the following location C:\Program Files\Resource Kit  you would be presented the start window as seen below in figure 2

 

1.       As shown in figure 2 below select Export configuration of the local service to a file

 

Figure 2: DHCP Export Import Tool start Window

 

 

2.       On the export to file window (figure 3 below) select the path and name of the export file.

 

Figure 3: DHCP Export to file window

3.      Finally as seen in figure 4 select the scope/s that you want to migrate, if you are migrating the entire server then select all scopes. Also ensure that you check the checkbox Disable the selected scopes on local machine before export, then click Export.

 

Figure 4: DHCPEXIM Scope Selection Window

 

If you are exporting all of the scopes you may want to consider disabling the DHCP Server Service, so that the service will no longer start.

 

 

Exporting the DHCP Database from a Windows Server 2003 DHCP Server

 

To export the DHCP Database from a Windows Server 2003 DHCP server is performed via the use of the netsh command, as follows:

 

1.       Open a command prompt Start in the Run box type cmd press Enter

2.       In the command prompt type the following command

Netsh dhcp server export c:\temp\dhcpServerName.txt all <press enter>

               

You have now successfully exported the DHCP database and configuration from Windows Server 2003, copy this export text file to your import server and you can continue to the Import section below,

 

Importing the DHCP Database and configuration into a Windows Server 2003 DHCP Server

 

To start this task requires that you have the DHCP Server Service installed.

 

1.       First ensure that you have the DHCP Server Service installed, this service is started.

 

2.       Open a Command Prompt (Start Run Type cmd Press enter)

 

3.       Type and run the following command in the command prompt

 

Netsh dhcp server import c:\temp\dhcpServerName.txt all  <Press Enter>

 

4.       Finally open the DHCP Admin tool and check all scopes if all is ok, in the DHCP Admin tool where you see the server name right click and select Authorize as shown in figure5 below

Figure 5: Authorize DHCP Server

 

You have now completed migrating your DHCP Server, please post any comments or suggestions below. In addition if you have any article suggestions please send them to me via the contact link/form.

 

Related Articles

WindowsIS.com

   Requirements for 64 bit Guest Virtualization

ExchangeIS.com

  AD and Exchange InterOrg Migration A Real World Example Part 1

  Using ADModify – A Real World example

  Using CSVDE – A Real World Example

Published Tuesday, June 12, 2007 10:50 AM by ben hoffman

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Jaane Kyon said:

Excelent Doc, thanks heaps :)

April 9, 2008 4:09 PM
 

Steven Shue said:

I'd like to ask about Microsoft's suggestion and how it's different from yours.  Microsoft http://technet2.microsoft.com/windowsserver/en/library/4207a8c1-2788-4be8-b9f8-ce28501a24571033.mspx?mfr=true suggests doing a backup and restore.

Is there any real difference between export/import and backup/restore?

I'm looking to rebuild a domain controller and want to be sure I'm getting everything for DHCP so I don't need to manually configure settings when the config is complete.

--Steven M. Shue

sshue@spunkmeyer.com

May 6, 2008 7:55 AM
 

Abhishek said:

Can we migrate more than one windows 2000  DHCP server into one windows 2003  DHCP server..??

May 16, 2008 10:38 PM
 

Abhishek said:

Please reply me on abhisheksrivastava84@yahoo.com

May 19, 2008 5:25 PM
 

Jean-Claude said:

to answer Abhishek:

Yes, you can import multiple databases, as long as they have unique subnets.  The import is done on a subnet by subnet basis.

August 1, 2008 6:20 AM
 

Abhishek said:

Thanx a lot Jean-Claude for your information. But  multiple databases import is not  is not working through netsh command... may be due to some bad luck.. I have created manually all the desired scopes and it's working.

August 9, 2008 11:02 PM
 

Dave said:

With this method, do i need to shorten up the leases periods on the old 2k3 server that I am replacing.  Nomally I would setup the scopes, shorten the leases, get all the pc's to renew on the shorter lease. Activate the new scope, deactivate the old....end of story.

With this method my impression is that I can use the netsh command to export/import everything, authorize the new server, and deactivate the old one.

Thanks,

Matt

August 13, 2008 6:02 AM
 

Laurie said:

OK, I did the import from my old server (Win2K3) and exported into my new server (Win2k8).  It picked up the scope, exclusions, and server options, but no reservations, which is what I was trying to avoid having to redo manually.  Is this a 2003/2008 issue, or does anyone have any other ideas what might have gone wrong and how I can fix it?

September 13, 2008 1:57 AM
 

Marc said:

Yeah, I'm with Laurie. I'm making an even larger leap though from 2000 server to 2008. Do i need to import into 2003 first? The Netsh stuff looks the same and appears to work, but then there are no reservations or address pools successfully imported. I can see the data in the .txt file create from the Dhcpexim.exe utility after I used Jetpack, but netsh on the 2008 server doesn't seem to like it. Netsh appears to work on 2000 as well where the data is readable. But 2008 doesn't import successfully there as well.

September 13, 2008 6:50 AM
 

Bryan said:

I assume that you need to "stop" the DHCP service on the old server once you have successfully exported the database?

October 24, 2008 5:19 AM
 

Bakia Ndip said:

Excellent material. It works like magic. Thanks

December 12, 2008 12:54 PM
 

Cristian said:

Hi all, I have a doubdt, in Windows Server 2003, DHCP options has 3 option: DHCP Only, bootp and Both.

Where can I found that in Windows NT 4 ????

Thanks a lot!

Cristian from Spain

January 15, 2009 2:55 AM
 

Cristian said:

How about migrating only one SCOPE from one Win 2000 Server to another Win 2003 server?

Can you explain the procedure?

Thank

March 20, 2009 10:45 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Commercial Edition), by Telligent Systems