Sie sind auf Seite 1von 8

This step-by-step article describes how to move a Dynamic Host Configuration Protocol (DHCP) database from a computer that

is running Microsoft Windows NT Server 4.0, Microsoft Windows 2000, or Microsoft Windows Server 2003 to a computer that is running Windows Server 2003.

Note You can use the Microsoft Windows backup utility (ntbackup.exe) to back up and restore the DHCP database on a single server. Do not use the backup utility to migrate or to move a DHCP database from one DHCP server to another. Back to the top

Export the DHCP database from a server that is running Windows NT Server 4.0 or Windows 2000

1.

Stop the DHCP Server service on the server:

a.

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

b. c.

Click Start, click Run, type cmd in the Open box, and then click OK. At the command prompt, type net stop dhcpserver, and then press ENTER. You receive a "The Microsoft DHCP Server service is stopping. The Microsoft DHCP Server service was stopped successfully" message.

d. 2.

Type exit, and then press ENTER.

Compact the DHCP database by using the JetPack utility:

a.

Click Start, click Run, type cmd in the Open box, and then click OK. b. c. d. At the command prompt, type cd %systemroot%\system32\dhcp, and then press ENTER. Type jetpack dhcp.mdb temp.mdb, and then press ENTER. After the database is compacted successfully, type exit, and then press ENTER.

2.

Export the DHCP database by using the DHCP Export Import utility (Dhcpexim.exe). You can obtain this utility from the Windows 2000 Resource Kit Supplement 1. You can also visit the following Microsoft Web site to obtain Dhcpexim.exe:

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

To export the database:

a.

Install the Dhcpexim.exe utility, and then start the Dhcpexim.exe utility. b. At the Welcome to DHCP Export Import tool screen, click Export configuration of the local service to a file, and then click Ok.

c.

In the File name box, type the file name for the exported file, and then click Save. For example, type dhcpdatabase.txt.

d.

Click the scope or scopes that you want to export, click to select the Disable the selected scopes on local machine before export check box, and then click Export.

e. 2.

Click OK.

Disable the DHCP Server service on the server. Disabling the DHCP Server service prevents the service from starting after the database has been transferred. To disable the DHCP Server service:

a. b. c. d.

Click Start, point to Settings, click Control Panel, and then double-click Services. In the Service list, click Microsoft DHCP Server, click Startup, click Disabled, and then click OK. If the service is started, click Stop, and then click Yes to confirm the stopping of the service. Click Close to close the Services dialog box.

Important Dhcpexim.exe is required to move the database successfully from a server that is running Windows 2000 or Windows NT 4.0 to a server that is running Windows Server 2003. Netsh commands for DHCP are not available in Windows NT 4.0.

Note If only the configuration (not the database) is required, use the following command (instead of Dhcpexim.exe) on the Windows 2000-based server that you want to export from. (Do not use Dhcpexim.exe.) netsh dhcp dump >C:\dhcp.txt where C:\dhcp.txt is the name and path of the export file that you want to use.

Note The export option does not exist in the netsh command on Windows 2000 Server. The netsh dhcp server dump and netsh dhcp server import commands are not compatible. If you try to import the data that is created by netsh dhcp server dump > C:\dhcp.txt by using netsh DHCP server import > C:\dhcp.txt, you receive the following error message on the Windows Server 2003-based computer: The request is not supported. You can migrate the exported configuration file to the new Windows Server 2003 server by using the following command: netsh exec c:\dhcp.txt Dhcpexim.exe is not supported in Windows Server 2003. If a database is exported on a Windows 2000-based computer by using Dhcpexim.exe, and you try to import the data to Windows Server 2003, Dhcpexim.exe quits, and you receive the following error message: An error occurred. An attempt was made to load a program with a incorrect format. If this behavior occurs, export data from Windows 2000 by using dhcpexim and then import the data on the Windows Server 2003 environment by using netsh DHCP server import xyz.txt.

Back to the top

Export the DHCP database from a server that is running Microsoft Windows Server 2003
To move a DHCP database and configuration from a server that is running Windows Server 2003 to another server that is running Windows Server 2003: 1. 2. 3. Log on to the source DHCP server by using an account that is a member of the local Administrators group. Click Start, click Run, type cmd in the Open box, and then click OK. Type netsh dhcp server export C:\dhcp.txt all, and then press ENTER.

Note You must have local administrator permissions to export the data. Back to the top

Install the DHCP server service on the server that is running Windows Server 2003
To install the DHCP Server service on an existing Windows Server 2003-based computer: 1. 2. 3. Click Start, click Control Panel, and then double-click Add or Remove Programs. Click Add/Remove Windows Components. In the Windows Component Wizard, click Networking Services in the Components box, and then click Details. 4. Click to select the Dynamic Host Configuration Protocol (DHCP) check box if it is not already selected, and then click OK. 5. In the Windows Components Wizard, click Next to install the selected components. Insert the Windows Server 2003 CD into your computer CD drive or DVD drive if you are prompted to do this. Setup copies the DHCP server and tool files to your computer. 6. When Setup is complete, click Finish.

Back to the top

Import the DHCP database


Note You may receive an "access denied" message during this procedure if you are not a member of the Backup Operators group. If you receive an "Unable to determine the DHCP server version for server" error message, make sure that the DHCP Server service is running on the server and that the user logged on is a member of the local Administrators group.

Important Do not use Dhcpexim.exe to import a DHCP database in Windows Server 2003. Additionally, if the target Windows 2003 server is a member server, and if you plan to promote it to a domain controller, we suggested that you perform the DHCP database migration before promoting it to a domain controller. Although you can migrate the DHCP

database to a Windows 2003 domain controller, the migration to a member server will be easier because of the existence of the local administrator account. 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 Administrators 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. 3. 4. 5. Copy the exported DHCP database file to the local hard disk of the Windows Server 2003-based computer. Verify that the DHCP service is started on the Windows Server 2003-based computer. Click Start, click Run, type cmd in the Open box, and then click OK. At the command prompt, type netsh dhcp server import c:\dhcpdatabase.txt all, 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.

Note When you try to export a DHCP database from a Windows 2000 domain controller to a Windows Server 2003 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 permissions to import the data.

6.

To resolve this issue, add the Windows Server 2003 DHCP server computer to the DHCP Admins group at the Enterprise level.

7.

If the "access is denied" error message occurs after you add the Windows Server 2003 DCHP server computer to the DHCP Admins group at the Enterprise level that is mentioned in step 4, verify that the user account that is currently used to import belongs to the local Administrators group. If the account does not belong to this group, add the account to that group, or log on as a local administrator to complete the import.

Note If the DHCP IMPORT or EXPORT command fails for users who are not explicit members of the local Administrators group, you must apply the following hotfix on the Windows Server 2003-based computer:

833167 A Volume Shadow Copy Service (VSS) update package is available for Windows Server 2003

8.

After you receive the message that the command completed successfully, quit the command prompt.

Back to the top

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. 4. Right-click the server object, and then click Authorize. After several moments, right-click the server again, and then click Refresh. A green arrow indicates that the DHCP server is authorized.

DHCP Database
DHCP has its own database. Stored in this DHCP.mdb are the addresses, scopes and leases of the clients. Understanding this database will help you backing up and restore a DHCP server. Check out this folder: %systemroot%\system32\dhcp\dhcp.mdb As time goes by the database will grow, and best practice dictates that you should consolidate the database by freeing up space taken up by old leases. The procedure for compacting the dhcp.mdb database is this. 1) Stop the DHCP service. Either right click the DHCP Server icon, select All tasks then Stop. Alternatively, go to the command line and type: NET Stop DHCPServer. (For once the command really is DHCPserver, NOT DHCPyourservername.) 2) At the command line, navigate to: %systemroot%\system32\dhcp\dhcp.mdb. 3) Jetpack dhcp.mdb temp.mdb. What this does is copies the existing database, compacts it, then copies it back to the original location - clever. 4) Remember to restart DHCP. Either use the GUI, or if you are at the command line, NET Start DHCPServer Warning: Do not 'mess' with any of the files that you find in the %systemroot%\system32\dhcp folder, if you do, then DHCP will stop working and you will either have to restore, or else re-install DHCP.

Backing up the DHCP Database


The first surprise is that this dhcp.mdb database is backed up every hour.

The second surprise is that the old jetpack database engine controls the database. The third surprise is that you can only automatically backup to a local folder. Should you need a 'real' backup, then just backup the files in the %systemroot%\system32\dhcp\Backup\ directory. Finally, and unsurprisingly, there is a GUI to backup the DHCP database.

Reconcile
Reconcile is a technical term for making sure that DHCP information is consistent. What can happen is that when you restore a database, there is a miss-match between lease information in the database and the same information in the DHCP server's registry. Specifically, the registry just stores basic or summary information, the detailed information from a recent restore maybe different, so a 'Reconcile' will ensure that the database and registry data are consistent once more. Bear in mind that you can either reconcile individual scopes or choose all scopes. It all depends on the 'focus' of what you select. If you select an individual scope that that is the limit of what you can reconcile, however, when you select the server icon, you can: Reconcile All Scopes - see diagram above. (not below)

DHCP Audit Log


Once you setup DHCP auditing, you get a separate log for each day of the week. The logs are a wealth of information, not just about the health of the server, but also which machine gets which IP address for how long. To setup Auditing, right click the DHCP server, then select properties. Auditing removes the last reason for having static IP addresses, accountability. Die-hards, Luddites who resist DHCP often justify static IP addresses on the grounds that you can always account for which machine had which IP address on a particular day. With DHCP Auditing you can achieve the same result and have all the benefits of central administration, instant control over default gateways and a raft of other options.

Backing up the DHCP database


Updated: January 21, 2005

Backing up the DHCP database


Maintaining a backup of the DHCP database protects you from data loss if the DHCP database is lost (for example, due to hard disk failure) or becomes corrupted. There are three backup methods supported by the DHCP Server service:

Synchronous backups that occur automatically. The default backup interval is 60 minutes. Asynchronous (manual) backups, performed by using the Backup command on the DHCP console. For more information about asynchronous backups, see Back up the DHCP database.

Backups using Windows Backup (ntbackup.exe) or non-Microsoft backup software. For more information about Windows Backup, see Backup.

When a synchronous or asynchronous backup occurs, the entire DHCP database is saved, including the following:

All scopes, including superscopes and multicast scopes Reservations Leases All options, including server options, scope options, reservation options, and class options All registry keys and other configuration settings (for example, audit log settings and folder location settings) set in DHCP server properties. These settings are stored in the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters To back up this subkey, open Registry Editor, and save the specified key to a text file. For more information, see Open Registry Editor and Import or Export Registry Keys.

Note

The DNS dynamic update credentials (user name, domain, and password) that the DHCP server uses when registering DHCP client computers in DNS are not backed up with any backup method.

Backup locations
The default DHCP database backup path is systemroot\System32\Dhcp\Backup. You can change the database backup folder by selecting a different local folder during a manual backup or by changing the backup folder location in DHCP server properties. For more information, see Set the DHCP database backup path. When planning your backup strategy, consider the following:

Synchronous backups are performed while the DHCP service is running. Similarly, when you perform asynchronous (manual) backups, you do not need to stop the DHCP service unless you are moving your database to a new server. For more information, see Move a DHCP database to another server.

Notes

The backup folder location must be a local path.

This topic assumes that the DHCP database and its backup directories are located on the default drive and path locations. The default automatic database backup interval is 60 minutes. You can change the automatic backup interval through the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters\BackupInterval Caution

Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

Do not store DHCP server backups on the same hard drive on which the DHCP service is installed, and make sure that the access control list (ACL) for the backup folder contains only the Administrators group and the DHCP Administrator group as members. In addition to performing manual backups, back up to other locations, such as a tape drive, and make sure that

unauthorized persons do not have access to your backup copies. You can use Windows Backup for this purpose. For more information, see Best practices for Backup.

Das könnte Ihnen auch gefallen