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

Extract an encrypted backup outside of Home Assistant? #36974

Open
jkosharek opened this issue Jan 17, 2025 · 6 comments
Open

Extract an encrypted backup outside of Home Assistant? #36974

jkosharek opened this issue Jan 17, 2025 · 6 comments

Comments

@jkosharek
Copy link

Feedback

How about instructions to extract an encrypted backup outside of Home Assistant? There should be an option to not encrypt the backups that would disable putting them on Home Assistant Cloud... Very frustrated with the lack of instructions to extract data from my backups and lack of options with the new backups.

URL

https://www.home-assistant.io/more-info/backup-emergency-kit/

Version

2025.1.2

Additional information

No response

@pos-dev-teach
Copy link

Hi, have a backup with my emergency kit file. I just want to access to some config files of my old HA instance. Right now the only way to do this is restoring the whole backup in a new instance. I think this is a bit frustrating too. Thanks

@erik434
Copy link

erik434 commented Jan 22, 2025

FWIW, I was just able to use this project to decrypt a HAOS 2025.1.3 backup: https://github.com/cogneato/ha-decrypt-backup-tool

But it would be great if there was an official tool for this, or an option to download a decrypted version of the backup (for example if you just need to extract a few files).

@jkosharek
Copy link
Author

FWIW, I was just able to use this project to decrypt a HAOS 2025.1.3 backup: https://github.com/cogneato/ha-decrypt-backup-tool

But it would be great if there was an official tool for this, or an option to download a decrypted version of the backup (for example if you just need to extract a few files).

What OS, I tried on windows and it didn't work. Did you put the dashes in the encryption key? Can you provide the redacted command you used?

@erik434
Copy link

erik434 commented Jan 22, 2025

@jkosharek I'm also running Windows. I think this ought to cover everything I did (installing all dependencies/etc.). You can skip steps as appropriate for your environment (if you've already got python 3.7 or newer/etc.); you can also just download the script manually instead of using wget, but I enjoy the commandline 🙂

winget install Python.Python.3.13
winget install JernejSimoncic.Wget

(you might need to open a new console at this point to refresh your environment and pick up the python/wget installs)

pip install cryptography

cd <directory with backup .tar>
wget https://raw.githubusercontent.com/cogneato/ha-decrypt-backup-tool/refs/heads/main/decrypt_backup.py
python .\decrypt_backup.py

(paste backup key when prompted; 7 groups of 4 characters, separated by dashes)

That's it! If you're getting any errors that don't seem related to missing dependencies, etc. then maybe worth opening an issue over in that repo?

@jkosharek
Copy link
Author

@jkosharek I'm also running Windows. I think this ought to cover everything I did (installing all dependencies/etc.). You can skip steps as appropriate for your environment (if you've already got python 3.7 or newer/etc.); you can also just download the script manually instead of using wget, but I enjoy the commandline 🙂

winget install Python.Python.3.13
winget install JernejSimoncic.Wget

(you might need to open a new console at this point to refresh your environment and pick up the python/wget installs)

pip install cryptography

cd <directory with backup .tar>
wget https://raw.githubusercontent.com/cogneato/ha-decrypt-backup-tool/refs/heads/main/decrypt_backup.py
python .\decrypt_backup.py

(paste backup key when prompted; 7 groups of 4 characters, separated by dashes)

That's it! If you're getting any errors that don't seem related to missing dependencies, etc. then maybe worth opening an issue over in that repo?

That works until they (I hope) will come up with a native way. Still can't figure out why WInRAR or 7-Zip doesn't prompt for a password. THANK YOU!

@erik434
Copy link

erik434 commented Jan 22, 2025

@jkosharek Glad that helped! I think the encryption scheme is nonstandard, which is why we have to use a script like this instead of any regular tools you might use to extract archives.

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

No branches or pull requests

3 participants