Restoring Backups Encryption

Yes I have been a silly boy - I wanted to get an old automation that I must have deleted and looked back in my backups and found the nearest date was last December (2024) so took a full backup today and restored the old December backup. Success there, I found and copied the automation code - great so far.

Went to restore the backup I took today and as you will all be aware (apart from me apparently) it is asking for an encryption code, I don’t have one!

The December restore is telling me that everything is out of date including Home Assistant Core so I updated to the latest (2025.10.1) which when you try to set up backups gives you an encryption key, I saved this one but it doesn’t work on the 2025 backups……

Can anyone help a silly boy……

Unfortunately you’re out of luck unless you can find the key (as in find somewhere you wrote it down or copied it) that was created when you originally setup your backups.

Thanks Ben, I have looked everywhere but can’t find anything……

Looks like I am setting up my Home Assistant from scratch :face_with_symbols_over_mouth:

And when you got everything running

Agreed, I do wonder why there is no warning when you do a backup that it is encrypted!!!

Anyway, it gets worse. Having restored a 2024 backup, I now can’t get a 2025 install to work, I am getting the following errors. Can anyone help at all

The following integrations and platforms could not be set up:

backup (Show logs)
cloud (Show logs)
default_config (Show logs)
ramses_cc (Show logs)

Please check your config and logs.

Log shows:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 425, in _async_setup_component
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/backup/init.py”, line 106, in async_setup
await backup_manager.async_setup()
File “/usr/src/homeassistant/homeassistant/components/backup/manager.py”, line 381, in async_setup
stored = await self.store.load()
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/backup/store.py”, line 106, in load
return await self._store.async_load()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/storage.py”, line 289, in async_load
result = await self._async_load()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/storage.py”, line 309, in _async_load
return await self._async_load_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/storage.py”, line 412, in _async_load_data
stored = await self._async_migrate_func(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data[“version”], data[“minor_version”], data[“data”]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/usr/src/homeassistant/homeassistant/components/backup/store.py”, line 57, in _async_migrate_func
if (state := data[“config”][“schedule”][“state”]) in (“daily”, “never”):
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: ‘state’

Open one of the SSH add-ons, and run

ha core rebuild
ha supervisor repair

Thanks Francis, will that kill my database too?

No, does not influence your database

Sadly that has not fixed the issue, still the same invalid config message.

What version of HA did you upgrade to ?

2024.12.5 is the last one that works. I am currently on 2025.10.1 Core and 2025.10.0 Supervisor.
I have tried a few 2025 Core and they have all had the same issue showing in the log.

Does restarting HA in safe mode work ?

It works but the invalid config still persists.

still the same error messages ?

Maybe disable

Yes same error. Will disable Ramses and try again.

With Ramses disabled the configuration errors are backup, cloud and default_config.

Here is the log now:

Error during setup of component backup: ‘state’
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 425, in _async_setup_component
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/backup/init.py”, line 106, in async_setup
await backup_manager.async_setup()
File “/usr/src/homeassistant/homeassistant/components/backup/manager.py”, line 381, in async_setup
stored = await self.store.load()
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/backup/store.py”, line 106, in load
return await self._store.async_load()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/storage.py”, line 289, in async_load
result = await self._async_load()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/storage.py”, line 309, in _async_load
return await self._async_load_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/storage.py”, line 412, in _async_load_data
stored = await self._async_migrate_func(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data[“version”], data[“minor_version”], data[“data”]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/usr/src/homeassistant/homeassistant/components/backup/store.py”, line 57, in _async_migrate_func
if (state := data[“config”][“schedule”][“state”]) in (“daily”, “never”):
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: ‘state’

Start with 2025.1, fix all breaking changes, and move one one release at the time.

Sadly I think it’s a forlorn hope…… going from Dec 24 to Jan 25 highlighted that the database schema had changed with lots of other issues.
I am going to do a fresh install.
Thank you so much for your assistance. Big lesson learned here. I just hope it alerts other users to the perils.
Peter