jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
MIT License
308 stars 48 forks source link

Provide a Backup/Restore Option #270

Closed dlindnegm closed 6 months ago

dlindnegm commented 8 months ago

During multiple beta version upgrades I sometimes was able to upgrade by downloading the newer version and restarting, while other times ) most recently going from beta 17 to beta 18) the upgrade would fail with the HA integration generating the error: "Failed to setup". In testing I found that as long as the file smart_irrigation.storage from the previous version was present the HA integration install would fail, but if I first deleted the .storage file it would succeed, although doing so would cause all of my sensors and zones to be lost (reset to defaults). It seems like some of these upgrades may have changed the schema and the previous versions .storage file was no longer compatible.

I'm not sure if this was only happening because of the numerous beta changes and won't be an issue moving forward, but if it can continue to happen it would be nice to have a feature where once everything is set up you could export your settings (mostly the sensors and zone info) to a config file and import them at a later time, either after a failed upgrade or just as an option to test different configurations. The only thing that we wouldn't need to backup/restore would be any weather data.

jeroenterheerdt commented 8 months ago

Thanks, well actually this was caused by a lazy developer. Me. The storage file is actually migratable, is can upgrade itself but I never got that to work.

jeroenterheerdt commented 8 months ago

plan: implement this by bumping up a version artificially and comparing to the first beta. Take the diff and make sure that is handled.

dlindnegm commented 8 months ago

Update from beta18 to beta 21 went without any issues here.

github-actions[bot] commented 6 months ago

Stale issue message