I can extract the tar, no problem. But then files inside can’t be extracted. take homeassistant.tar.gz for example and test on the cmd line:
$ gzip -t homeassistant.tar.gz
gzip: homeassistant.tar.gz: not in gzip format
What the…
All my backups are like this. Can’t extract a single one. I see the size is more or less what I’d expect.
UPDATE:
so I discovered that this issue exists when I navigate to the backup directly on my NAS and extract the files from there. If I “download” the backup from the HA UI, and extract the downloaded file, everything is ok. What’s going on?
You can’t. You have 2 solutions: disable encryption in settings to save your backup unencrypted or download backup from HA as HA decrypts the file before download
HA by default stores backup encrypted with the encryption key. When needed (you download a backup from HA or you restore on the same system) it decrypts the backup so you don’t have to. There is no official and available tool to decrypt backups.
If you want to decrypt backups by yourself, you can try one of those scripts:
I have reviewed the source code and home assistant does not store the encrypted key with the backup. Only the salt is stored with each encrypted file inside of the Tar backup.
The salt paired with the AES key derives the IV (and the AES key is derived from the backup password). See my previous message where I provide a generic breakdown of how home assistant encrypts backups.