Imagine the scenario: my Conbee II stick goes bad. I plug in a Sonoff Zigbee 3 stick and want to migrate to this. But, where is my backup?
The ZHA documentation says, ‘Backups are taken automatically,’ but where are they stored?
I know I can make a backup and download it but this requires me to remember to do this on a regular basis. I don’t trust me to do this.
Tinkerer
(aka DubhAd on GitHub)
October 16, 2022, 11:01am
2
I’m not sure that ZHA supports automatic migration between different coordinator types.
The ZHA integration has a migrate radio button on its interface. It was introduced a few releases ago.
Tinkerer
(aka DubhAd on GitHub)
October 16, 2022, 2:45pm
4
And that’s not automatic migration
ZHA’s backups are included in the complete HA backup.
And automatic migration isn’t automatic backup.
Anyway, I’ll see if I can find out in the HA backup
CaptTom
(Tom)
October 16, 2022, 3:53pm
6
I saw this, too, and thought: Where? When? How Often? How do I find it to restore?
following @Tinkerer 's suggestion I’ve had a look through a full backup and can’t see anything that appears to be a backup for my Zigbee controller.
I downloaded a backup from the ZHA integration and got a .json file. I can see nothing like this in the backup.
I’m puzzled.
jose1711
(Jose Riha)
March 16, 2024, 9:02pm
8
The backup is configured inside zigpy
module. Namely application.py
:
if self.config[conf.CONF_NWK_BACKUP_ENABLED]:
self.backups.start_periodic_backups(
# Config specifies the period in minutes, not seconds
period=(60 * self.config[conf.CONF_NWK_BACKUP_PERIOD])
)
The backup period seems to be hardcoded and scheduled to run every 24 hours (zigpy/zigpy/config/defaults.py at 377c3031cf1a9b2c6a377e034f24b09ed39ccf6d · zigpy/zigpy · GitHub ). I believe it’s stored inside an SQLite database zigbee.db
within HA config directory.
For restore… you may be able to extract the json data out of the database and then use GitHub - zigpy/zigpy-cli: Command line interface for zigpy to restore network data. But I haven’t tested yet so not sure if it would work.
1 Like