zigbee2mqtt / hassio-zigbee2mqtt

Official Zigbee2MQTT Home Assistant add-on
https://www.zigbee2mqtt.io
Apache License 2.0
1.18k stars 432 forks source link

Backup of Zigbee2mqtt addon does not contain eg. friendly names of devices #627

Closed heikkis closed 1 month ago

heikkis commented 4 months ago

Description of the issue

Addon version

1.39.0-1

Platform

All latest Core 2024.7.2 Supervisor 2024.06.2 Operating System 12.4 Frontend 20240710.0

Logs of the issue (if applicable)

No response

heikkis commented 4 months ago

Same result for 1.35.1-1 version backup and 1,5 year backwards even. Now I'm wondering where the device data should be if it is not in the addon's backup file.

Only these files are in the backup:

./addon.json
data/
data/options.json
BobMac57 commented 4 months ago

Same as above, just the options.json file..

heikkis commented 4 months ago

I have found out that Zigbee2Mqtt addon provides backup functionality itself (basically it will make zip file of /data folder) which include all device settings, eg. friendly names and so on. Mind blowing, it seems not to be integrated to native addon backup feature.

Any ideas what that would mean in implementation? People are expecting that backup of addon would include all needed data to restore the addon. Clearly that is not the case currently.

BobMac57 commented 4 months ago

I have found out that Zigbee2Mqtt addon provides backup functionality itself (basically it will make zip file of /data folder) which include all device settings, eg. friendly names and so on. Mind blowing, it seems not to be integrated to native addon backup feature.

Any ideas what that would mean in implementation? People are expecting that backup of addon would include all needed data to restore the addon. Clearly that is not the case currently.

I saw that earlier and as far as I'm aware, this is the only addon that does this... doesn't make me a happy camper having to run a 2 step process to get a zip backup when IMO , should be in the HA backup strategy...

FrankGiesecke commented 4 months ago

This is very bad, as some of use use backup plans and make regular automated backups of HA. In my case, I use the „Home Assistant Google Drive Backup“ to do this. So the resulting Backup is worth than nothing

Koenkk commented 4 months ago

I checked a bit why this happens but cannot spot the error yet. The HA addon backup code creates a backup of the config which the addon defines here. Would be greatly appreciated if someone with more knowledge about HA addons could investigate this (I don't have a HASS setup myself)

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

FrankGiesecke commented 3 months ago

Is there anyone working on this issue?

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

FrankGiesecke commented 2 months ago

This issue still exists

ptfuzi commented 2 months ago

This is still an issue, how to backup?

BigBoot commented 1 month ago

The problem is that the addon is mounting the general homeassistant config rather than the addon_specific one, i.e.

  "map": [
    "share:rw",
    "config:rw"
  ],

should be

  "map": [
    "share:rw",
    "addon_config:rw"
  ],

But changing this now means existing users will need to manually migrate their config files to the new location.

A less invasive approach would be to just mount the addon_config in addition to the current config and update the default for data_path so new users would automatically get the addon_config and existing setups would continue to work with the option for manual migration.

@Koenkk Please let me know if you'd like to see a PR for one of those

Koenkk commented 1 month ago

@BigBoot I would love a PR, seems the second approach is the best