Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration to addon_config #649

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

BigBoot
Copy link
Contributor

@BigBoot BigBoot commented Oct 27, 2024

Second part of #642 intended for 2.0.0

@Koenkk Koenkk merged commit 9b53af3 into zigbee2mqtt:feat/2.0.0 Oct 28, 2024
1 of 11 checks passed
@Koenkk
Copy link
Contributor

Koenkk commented Oct 28, 2024

Thanks!

Koenkk pushed a commit that referenced this pull request Dec 1, 2024
* mount addon_config into container

* add addon_config migration
export ZIGBEE2MQTT_DATA="$(bashio::config 'data_path')"

# Migrate configuration to addon specific data path for HA backups, see https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/issues/627
if [[ "$ZIGBEE2MQTT_DATA" == "/addon_config/zigbee2mqtt" ]] && ! bashio::fs.file_exists "$ZIGBEE2MQTT_DATA/configuration.yaml" && bashio::fs.file_exists "/config/zigbee2mqtt/configuration.yaml"; then
Copy link
Contributor

@Nerivec Nerivec Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the folder is named addon_configs not addon_config?
(same for other refs in PR, and #642)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config folder is mounted to /addon_config/ as specified in the config.json

@Koenkk
Copy link
Contributor

Koenkk commented Dec 2, 2024

I've reverted this PR for now since it caused for setups breaking: #665 / #664

@BigBoot
Copy link
Contributor Author

BigBoot commented Dec 2, 2024

I've reverted this PR for now since it caused for setups breaking: #665 / #664

I'm confused though, this shouldn't even be in 1.42.x right? And I also don't see any changes actually being reverted?

avbor pushed a commit to avbor-z2m/hassio-zigbee2mqtt-1 that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
avbor pushed a commit to avbor-z2m/hassio-zigbee2mqtt-2 that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
avbor pushed a commit to avbor-z2m/hassio-zigbee2mqtt-3 that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
avbor pushed a commit to avbor-z2m/hassio-zigbee2mqtt-4 that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-1/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-2/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-3/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-4/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-6/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-7/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-8/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-9/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-10/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
benjamin-dcs pushed a commit to multi-z2m-5/hassio-zigbee2mqtt that referenced this pull request Dec 3, 2024
* mount addon_config into container

* add addon_config migration
@Koenkk
Copy link
Contributor

Koenkk commented Dec 3, 2024

@BigBoot yes something really weird happend. It's almost as if the addon was picking the config.json from the branch. I reverted it by removing the changes from the master branch, parked the changes in https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/commits/2.0.0/

@Koenkk
Copy link
Contributor

Koenkk commented Dec 3, 2024

As explained on the HA docs, the config.json is loaded from the repository. So what happened is that the data_path changed (config.json) without the migration being in place (not part of the 1.42.0-* images). We have to find a way to "tie" both together.

https://developers.home-assistant.io/docs/add-ons/configuration/

Screenshot 2024-12-03 at 20 25 48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants