Backup of .storage with git

Hi,

I currently use git for version control of my yaml files (excluding secrets.yaml).
According to the latest news article (https://www.home-assistant.io/blog/2020/04/14/the-future-of-yaml/), it seems that I should also be adding files from the .storage folder to my git repository.

Unfortunately I do not know which files to add. It seems some of them are being constantly updated.

What files do you backup ?

2 Likes

In theory, you would backup the entire .storage folder. This is also what happens when you do a snapshot, so rather be safe than sorry.

If you backup the entire .storage folder to Github, you’ll expose all your credentials. When you setup an integration with the GUI, the details will be saved in the .storage files somewhere together with the credentials.

git != github

I know, but I somehow assume it’s a public repo, otherwise I don’t see a reason to not upload the secrets.yaml file as well or is there a reason to not upload it in a private git repo?

2 Likes

I am actually storing these on a private git repository. I would still rather avoid committing anything secret / personnal related.

Anything that includes a timestamp like “last update time” should be avoided as I do not want to do new commits only for timestamp updates.

So does anyone know which of the files in .storage can be backed up this way and which should not ?

I use HA as a docker container on Raspbian and would also like to add the .storage directory to my local git repo.

Most files in .storage are owned by root and some have very restrictive permissions (600 vs. 644). This complicates matters when trying to add and commit them to my repo.

How do you deal with that?

One way to interact with the config files outside of the docker container is to have HA not run as root inside the container. The link below has a method for running the official HA container as non-root.

1 Like

LinuxServer does it already for you:

LinuxServer is a “Docker Sponsored OSS” Docker Hub