2025.3 Upgrade - Lost all history & statistics

I upgraded to 2025.3 around noon today. I now have no previous data in the system.

Should I restore the backup? It appears that these data are missing from the underlying database

The oldest STATES record are from after the upgrade

Oldest statistics are the same

Logbook is also blank for yesterday

If HA detects a corrupted sqlite database it will save off the old database as <filename>.corrupt and start a fresh database for you.

Possibly you have some kind of disk corruption issue, you can check for the presence of this file or messages in your log.

You can attempt to restore a backup.

Thanks for the reply

Indeed I do have this file!
Is there any way to understand what HA thinks is the specific corruption in there?

I’m not sure, you can check if there’s something in the logs, but it’s probably some kind of issue with a checksum.

I’ve had good luck copying the .corrupt DB file to my laptop, renaming it back to the original name, running a “repair” in DB browser for SQLite, and copying to back to the HA machine.

Thank you for the suggestion @CaptTom

After having a failed restore from backup, I tried to get this corrupt file off the server but it had vanished!

I am also getting errors when trying to restore the backup

It seems to be complaining that it cannot remove /data/homeassistant/tts
I’ve never use text to speech on this install so I will try removing that directory manually and running the restore again

2025-03-06 20:36:41.923 INFO (MainThread) [supervisor.backups.manager] Partial-Restore 5bdd9a0e start
2025-03-06 20:36:42.717 INFO (MainThread) [supervisor.backups.manager] Restore 5bdd9a0e starting stage folders
2025-03-06 20:36:42.723 INFO (SyncWorker_4) [supervisor.backups.backup] Restore folder ssl
2025-03-06 20:36:42.728 INFO (SyncWorker_4) [supervisor.backups.backup] Restore folder ssl done
2025-03-06 20:36:42.728 INFO (MainThread) [supervisor.backups.manager] Restore 5bdd9a0e starting stage home_assistant
2025-03-06 20:36:42.736 INFO (SyncWorker_2) [supervisor.docker.manager] Stopping homeassistant application
2025-03-06 20:36:42.903 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_vscode closed
2025-03-06 20:36:43.691 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from a0d7b954_ssh
2025-03-06 20:36:49.751 INFO (SyncWorker_2) [supervisor.docker.manager] Cleaning homeassistant application
2025-03-06 20:36:52.160 INFO (SyncWorker_0) [supervisor.homeassistant.module] Restore Home Assistant Core config folder
2025-03-06 20:36:52.271 CRITICAL (SyncWorker_0) [supervisor.utils] Can't remove folder /data/homeassistant: find: ‘/data/homeassistant/tts’: Bad message
find: cannot delete ‘/data/homeassistant/tts’: Bad message
find: cannot delete ‘/data/homeassistant’: Directory not empty
2025-03-06 20:36:54.616 ERROR (SyncWorker_0) [supervisor.homeassistant.module] Can't restore origin data: [('/data/tmp/tmpgi7omal9/data/tts', '/data/homeassistant/tts', "[Errno 74] Bad message: '/data/homeassistant/tts'")]
2025-03-06 20:36:54.710 ERROR (MainThread) [supervisor.backups.manager] Restore 5bdd9a0e error
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 497, in _restore_home_assistant
    shutil.copytree(
    ~~~~~~~~~~~~~~~^
        temp_data,
        ^^^^^^^^^^
    ...<2 lines>...
        dirs_exist_ok=True,
        ^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/shutil.py", line 593, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
                     ignore=ignore, copy_function=copy_function,
                     ignore_dangling_symlinks=ignore_dangling_symlinks,
                     dirs_exist_ok=dirs_exist_ok)
  File "/usr/local/lib/python3.13/shutil.py", line 547, in _copytree
    raise Error(errors)
shutil.Error: [('/data/tmp/tmpgi7omal9/data/tts', '/data/homeassistant/tts', "[Errno 74] Bad message: '/data/homeassistant/tts'")]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/backups/manager.py", line 697, in _do_restore
    task_hass = await backup.restore_homeassistant()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 312, in wrapper
    raise err
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
    return await self._method(obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/backups/backup.py", line 864, in restore_homeassistant
    await self.sys_homeassistant.restore(
        homeassistant_file, self.homeassistant_exclude_database
    )
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 312, in wrapper
    raise err
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 304, in wrapper
    return await self._method(obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 522, in restore
    data = await self.sys_run_in_executor(_restore_home_assistant)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 504, in _restore_home_assistant
    raise HomeAssistantError(
        f"Can't restore origin data: {err}", _LOGGER.error
    ) from err
supervisor.exceptions.HomeAssistantError: Can't restore origin data: [('/data/tmp/tmpgi7omal9/data/tts', '/data/homeassistant/tts', "[Errno 74] Bad message: '/data/homeassistant/tts'")]
2025-03-06 20:36:54.735 INFO (MainThread) [supervisor.backups.manager] Restore 5bdd9a0e starting stage await_home_assistant_restart
2025-03-06 20:36:54.749 INFO (MainThread) [supervisor.homeassistant.module] Update pulse/client.config: /data/tmp/homeassistant_pulse
2025-03-06 20:36:55.145 INFO (MainThread) [supervisor.docker.homeassistant] Starting Home Assistant ghcr.io/home-assistant/qemux86-64-homeassistant with version 2025.2.4
2025-03-06 20:36:55.146 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2025-03-06 20:36:59.257 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state freeze
2025-03-06 20:36:59.257 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2025-03-06 20:37:00.150 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to APIState(core_state='NOT_RUNNING', offline_db_migration=False)
2025-03-06 20:37:04.139 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from a0d7b954_ssh

Well, now I’m really in a pickle.

“/data/homeassistant/tts” didn’t exist so I tried “ha supervisor restart”
The web page no longer loads

According to cUrl it now returns and empty response

curl http://100.102.111.111:8123/ -vvv
*   Trying 100.102.111.111:8123...
* Connected to 100.102.111.111 (100.102.111.111) port 8123 (#0)
> GET / HTTP/1.1
> Host: 100.102.111.111:8123
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Empty reply from server
* Closing connection 0
curl: (52) Empty reply from server

And restoring a backup from the command line doesn’t run!

ha backups restore 5bdd9a0e 
Processing... Done.

Error: 5bdd9a0e is only a partial backup!