1)windows2003
netsh dhcp server dump > c:\exportdhcp_win2003.txt
2)windows2008R2
netsh dhcp server dump > c:\importdhcp_win2008r2.txt
3)查看windows2003dhcp服务器导出的文件exportdhcp_win2003.txt
有以下内容:
-----------------------------------
Dhcp Server 172.17.88.103 Add Class "默认路由和远程访问类别" "远程访问客户端的用户类别" 525241532e4d6963726f736f6674 0 b
Dhcp Server 172.17.88.103 Add Class "默认 BOOTP 的类别" "BOOTP 客户端的用户类别" 424f4f54502e4d6963726f736f6674 0 b
Dhcp Server 172.17.88.103 Add Class "Microsoft Windows 2000 选项" "Windows 2000 客户端的 Microsoft 供应商特定选项" 4d53465420352e30 1 b
Dhcp Server 172.17.88.103 Add Class "Microsoft Windows 98 选项" "Windows 98 客户端的 Microsoft 供应商特定选项" 4d534654203938 1 b
Dhcp Server 172.17.88.103 Add Class "Microsoft 选项" "适用于 Windows 98 和 Windows 2000 客户端的 Microsoft 供应商特定选项" 4d534654 1 b
------------------------------------
4)查看windows2008R2dhcp服务器导出的文件importdhcp_win2008r2.txt
有以下内容:
-内容A---------------------------------------------
# =====================================
# Add Classes
# =====================================
Dhcp Server \\WIN-8A0G94PHHBT Add Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b
Dhcp Server \\WIN-8A0G94PHHBT Add Class "Default Network Access Protection Class" "Default special user class for Restricted Access clients" 4d5346542051756172616e74696e65 0 b
Dhcp Server \\WIN-8A0G94PHHBT Add Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b
Dhcp Server \\WIN-8A0G94PHHBT Add Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 and above Clients" 4d53465420352e30 1 b
Dhcp Server \\WIN-8A0G94PHHBT Add Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 Clients" 4d534654203938 1 b
Dhcp Server \\WIN-8A0G94PHHBT Add Class "Microsoft Options" "Microsoft vendor-specific options applicable to all Windows Clients" 4d534654 1 b
# =====================================
# Add Classes End
# =====================================
-----------------------------------------------
5)使用以下命令行在windows2003dhcp服务器上删除注册类:
---------------------------------------------------------
netsh Dhcp Server 172.17.88.103 delete Class "默认路由和远程访问类别" "远程访问客户端的用户类别" 525241532e4d6963726f736f6674 0 b
netsh Dhcp Server 172.17.88.103 delete Class "默认 BOOTP 的类别" "BOOTP 客户端的用户类别" 424f4f54502e4d6963726f736f6674 0 b
netsh Dhcp Server 172.17.88.103 delete Class "Microsoft Windows 2000 选项" "Windows 2000 客户端的 Microsoft 供应商特定选项" 4d53465420352e30 1 b
netsh Dhcp Server 172.17.88.103 delete Class "Microsoft Windows 98 选项" "Windows 98 客户端的 Microsoft 供应商特定选项" 4d534654203938 1 b
netsh Dhcp Server 172.17.88.103 delete Class "Microsoft 选项" "适用于 Windows 98 和 Windows 2000 客户端的 Microsoft 供应商特定选项" 4d534654 1 b
---------------------------------------------------------
6)copy出windows2008R2dhcp服务器导出的文件相应注册类内容,并修改主机或ip名称以适合windows2003服务器使用
-内容B--------------------------------------------------
netsh Dhcp Server 172.17.88.103 Add Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b
netsh Dhcp Server 172.17.88.103 Add Class "Default Network Access Protection Class" "Default special user class for Restricted Access clients" 4d5346542051756172616e74696e65 0 b
netsh Dhcp Server 172.17.88.103 Add Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b
netsh Dhcp Server 172.17.88.103 Add Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 and above Clients" 4d53465420352e30 1 b
netsh Dhcp Server 172.17.88.103 Add Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 Clients" 4d534654203938 1 b
netsh Dhcp Server 172.17.88.103 Add Class "Microsoft Options" "Microsoft vendor-specific options applicable to all Windows Clients" 4d534654 1 b
------------------------------------------------------
7)在windows2003服务器上以cmd方式运行内容B,在windows2003上注册修改后windows2008R2的类。
使用命令netsh dhcp server dump检查是否新类被注册在windows2003的服务器上!
8)在Windows2003服务器上运行:Netsh dhcp server export c:\dhcp.txt all
9)在windows2008R2服务器上停止windows2008R2的dhcp服务。
10)在windows2008R2服务器下删除windows\system32\dhcp目录下的DHCP.mdb数据库。
11)在windows2008R2服务器上启动windows2008R2的dhcp服务。
12)在windows2008R2服务器下运行:netsh dhcp server import c:\dhcp.txt
导入到2008R2后,需要检查内容是否完整,需要手工补全!(我迁移时发现,路由、dns、ip地址范围、排除ip均有问题,不过大框可以迁移过来,避免手工量过大)