We have about 250 devices monitoring in a Zenoss Core 2.3.0. Now we decided to move the 2.5.1. The information we want to migrate from 2.3.0 is the devices, device group and device production state. The migration took two steps.
1.
zendevicedump -o
Run this command on 2.3.0. A xml generated contains device name and group information.
zendeviceload -i
Run this command on 2.5.1. All device were correctly loaded, and groups were created. Devices were correctly grouped according the xml.
The issue here is that the 'production state' was not exported to the xml file, so all devices in 2.5.1 are in 'production' state. To fix this issue, the DMD interface did the job.
2.Utilize the zendmd interface to export and import the device prodState and
2.1 Export from 2.3.0
f=open("/tmp/prodstat.txt","w")
for d in dmd.Devices.getSubDevices():
f.write(d.getDeviceName()+" "+d.getProdState()+"\n")
f.close()
2.2 Import to 2.5.1
>>> f=open("/tmp/prodstat.txt","r")
>>> for l in f:
... l = l.rstrip()
... name, state = l.split(" ")
... if state == "Decommissioned":
... number = -1
... elif state == "Maintenance":
... number = 300
... elif state == "Test":
... number = 400
... elif state == "Pre-Production":
... number = 500
... elif state == "Production":
... number = 1000
... d = find(name)
... d.setProdState(number)
...
>>>commit()
I have referenced to many articles in Zenoss Community, thanks.