Skip to content

Fix script to work with backups from HA version 2025.7.1+#4

Open
sicada wants to merge 1 commit into
azzieg:mainfrom
sicada:fix-hass-2025-7-1
Open

Fix script to work with backups from HA version 2025.7.1+#4
sicada wants to merge 1 commit into
azzieg:mainfrom
sicada:fix-hass-2025-7-1

Conversation

@sicada

@sicada sicada commented Sep 26, 2025

Copy link
Copy Markdown

This PR fixes the script to work with encrypted backup archives from HomeAssistant version 2025.7.1, and presumably newer versions as well (though I have not tested on newer versions).

I've also added a couple lines to print out some helpful info from the manifest (backup.json) since that's what helped me understand how to update this script in the first place.

Example output from the script based on this PR:

$ ./borgify-ha-backup.py -i hass-backup.tar -o hass-output.tar
Encryption key: ****-****-****-****
Reading backup.json manifest from input archive...
Found manifest info: 
    compressed: True
    date: 2025-09-17T18:05:55.360526-00:00
    extra: {'instance_id': '2a51bbc4c91b4ca00070644c777eabcd', 'with_automatic_settings': False}
    homeassistant: {'exclude_database': True, 'version': '2025.7.1'}
    name: hass-backup-2025-09-17
    protected: True
    slug: e7291008
    type: partial
    version: 2
$

…25.7.1 and also to print out some helpful info

@degerrit degerrit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the PR - this addresses the same problems I ran into and works for me on 2025.10 too!

I have a separate issue though, which I would address in my own PR (for my specific backup (>6GB sqlite DB) it only works with --compressed, indicating an issue with gzip ISIZE/footer or something).

Comment thread borgify-ha-backup.py
assert self._manifest['version'] == 2, 'Only manifest version 2 is supported.'

if self._manifest['protected']:
assert self._manifest['crypto'] == 'aes128', 'Only AES-128 encryption is supported.'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will this break restoring backups of older versions?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't know. Unfortunately I don't have any backups that are old enough to test with.

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