Hi all, I’m on the latest HA (2023.6.2). If i upgrade to the latest Zigbee 1.31.2, I lose my devices. What files do i need to backup and restore in order to upgrade? For some reason, just upgrading the repository doesnt seem to work.
Devices are stored on the zigbee controller. Or so I thought.
How have you installed zigbee2mqtt?
On my installation, I have the MQTT server and zigbee2mqtt installed on a separate linux server (VM) to HA and I use the upgrade script documented at the bottom of the installation docs page:
The script does a backup of /opt/zigbee2mqtt/data and restores it after the upgrade.
If you are using the HA zigbee2mqtt add-on, you can try taking a backup of the zigbee2mqtt subfolder and restore it after the update if the devices are not there after updating.
I think they are tied to the controller, but not stored there.
No ive an HA integrated zigbee2mqtt and this doesnt use the same file structure. I gave up in the end and reinstalled zigbee2mqtt anew, lost my devices, but i didnt have many to reconnect. I’ve decided to go for a standalone POE zigbee adapter and also to install zigbee2mqtt on a seperate raspberry. This is work in progress!
So to answer my own question… If you want to upgrade the onboard version of zigbee2mqtt (in my case from 1.18 to 1.31), then you need to make a backup of this folder, which is on the underlying physical server (/usr/share/hassio/share/zigbee2mqtt/) and the uninstall the old version of zigbee2mqtt. Then, from addons, click the 3 dots and choose repositories and delete the old zigbee repository. From the same menu, add the new repository at (GitHub - zigbee2mqtt/hassio-zigbee2mqtt: Official Zigbee2MQTT Home Assistant add-on). I had to reboot before it appeared in my addons folder. Add the new zigbee2mqtt addon and then configure it adding the serial (port: /dev/ttyUSB0 ‘in my case’) and I also had to add my MQTT server details. Start the addon and it will create the necessary data folder under /config. Stop the addon. I then copied my backup (via SSH to the underlying physical server) from the backup dir i made, to the container share folder, which for me was (/usr/share/hassio/share/zigbee2mqtt/). Start the addon again and ‘hey presto’ all my devices reappeared, but now i am on the officially sanctioned version of zigbee2mqtt.