Zigbee2mqtt coordinator upgrade. How to backup/restore devices

Hello everyone.
I am trying to find a way to backup the paired devices in a home assistant supervised install on a vm. Here is mentioned a data folder but i do not seem to find it on my instance https://github.com/Koenkk/zigbee2mqtt/issues/3254 .
I tried following the official instructions on the zigbee2mqtt website but i ended up with an empty list when upgrading from a cc2531 to a cc2538. And that is not that nice when having zigbee TRVs and the heating system is based on some zigbee sensors. :expressionless:

So… anybody knows?

1 Like

Important: migrating will require you to repair all devices!

1 Like

Thank you for the link, but did you read all my post? Did you see the github link? Also, before this new instructions page o z2m website, there were some instructions on how to migrate.

So, still up! :slight_smile:

The GitHub link is about backup/restore without change of coordinator hardware.

Sorry for reveiving this topic, but it fits perfectly for my question. :slight_smile:

The newest version of Zigbee2MQTT (1.21.0) has, according to the changelog, the possibility to upgrade from z-stack 1.2 to 3.0. That would mean, if I don’t misunderstand the PR, we would be able to upgrade from an old coordinator to a new one without the need to re-pair the devices.

Could anyone tell me how? :slight_smile: Is it enough to backup the “old” data and just let Z2M do the rest after connecting the “new” coordinator?

Thanks! :slight_smile:

On my vm version of HassOS
it is in /Share/Zigbee2mqtt/
in a file called database.db

When i migrated my zigbee2mqtt from windows to HassOS, i only needed to copy this database.db file, didn’t have to re-pair anything :wink:

(btw, hi @paddy0174 , i know the answer to the original question…but not your question…sorry :wink:)

1 Like

I read it too, but there is little explanation on how to do it. I’m still waiting on my zbtube coordinator, so no hurry for me, but more information would be welcome.

So where do we get that information? :woozy_face: I’m not in a hurry as well, I have one of Sleash’s dongles here, sitting on my desk for a few months… :wink:

I’ll see if I can find something in the code, or I’ll ask at the Discord server… :smiley:

imo it’s a feature of zigbee2mqtt, not HA. I suggest to ask on z2m forum for details.

Someone already asked at Github in the PR. :slight_smile: So, we’re not alone! :smiley:

Here you go:

Just to make it easier, I’ll quote the text:

Found it myself thanks to the Discord channel and it worked!! :1st_place_medal: :partying_face: :sunglasses: :trophy:
You need a Python installation with this: zigpy-znp
and then check here for steps: backup-and-restore (don’t get confused by the NVM backup & restore in the next section - this only works for adapters which are physically the same!)

:slight_smile:

I’ll try later and report back!

1 Like

Read further down in the PR

You basically don't need to do anything. Properly shutdown z2m, remove the stick, put in the new stick (freshly erased and flashed) and start z2m. The backup should be restored onto new stick.

:man_shrugging:

2 Likes

Just for safety I’ll make a backup first, and then try to see if the “automatic” works or if I need to restore the backup. Nonetheless this is great, I don’t need to climb up the ladder to re-pair my temp sensor in about 5m height. :smiley: :rofl: :nerd_face:

1 Like

Just flashed 20210708 Z-Stack firmware on a Tube’s USB coordinator, no problems starting z2m

1 Like

Just to clarify, you do mean without re-pairing your devices? :rofl:

1 Like

YES! No re-pairing! :joy:

1 Like

What device did you come from ?

Same device (Tube’s USB coordinator) just up’d the firmware.

Ok, new firmware on same device has never needed repairing.

1 Like

Was unsure.

Here we go, I found a few minutes earlier this evening. :smiley:

  • I stopped Z2M (addOn) and disabled “start at boot” and “watchdog”
  • shut down the rPi (just in case and I don’t like hot swapping)
  • pulled the old dongle (CC2531)
  • pushed the new one (Slaesh) in a different USB port
  • started the rPi
  • waited a few minutes, so HA was def. fully started
  • checked and changed the new USB port in Z2M config
  • started Z2M
  • waited a few minutes (read = felt hours, were seconds)
  • opened Z2M dashboard and checked
    • most devices were already there and online
    • just a few were kind of missing (eg showed up on the map, but weren’t connected in the map = no lines)
    • tried a new interview with one of them, didn’t change anything
    • no errors up to this point, whether in Z2M log, nor in HA log(s)
  • thought it is a good time to take a small walk with our puppy
  • came back after around half an hour and TADA :partying_face: :partying_face: :partying_face:
  • everything is working, reporting correct, is found on the map

So, to sum up: yep, the new “upgrade feature” works like a charme :smiley: Needless to say, always do a backup first. If you have one, you won’t need it, if you have none, you’ll want it! :wink:

3 Likes