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

Migrate HomeAssistant Config Files Location #541

Merged
merged 7 commits into from
Jan 13, 2025

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Nov 14, 2024

Proposed change

The new location will be backed up by a Home Assistant snapshot and is Home Assistant's preferred location for storing config files going forward.

  1. If a config.yaml file is not found in the new location; AND
  2. A config.yaml file is found at the old location; THEN
  3. Copy the entire contents of the old config directory to the new one
  4. Add a notice file to the old config directory telling users:
  • The new location of their config files
  • That they can delete these config files if everything is working correctly.

This process should ensure that no data is lost and should provide enough guidance to users on where their config files are located.

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass.
  • Code documentation was added where necessary
  • Documentation added/updated

I have updated and added comments about the location of the new config files in every location in documentation that I can think of.

Fixed some typos

The storage folder (data) is now defined in default installations
without any quoting which is how we handle the log file location.

Previously we used single quotes for storage, but the visual
code addon in Home Assistant would automatically change these to
double quotes, which is annoying.

So our sed mathing looks for any type of quoting and replaces
the default data directory with the new one without quotes.
@krkeegan
Copy link
Collaborator Author

I had to fix a few things, but the migration script works now!

There will be errors if a user has used a non-default log location or storage directory. This will need to be heavily noted in the release.

@krkeegan krkeegan merged commit 414b6eb into TD22057:dev Jan 13, 2025
1 check passed
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.

2 participants