{"record":{"id":"9092fbadb905dd81","repo":"home-assistant/core","slug":"you-need-at-least-home-assistant-version-backup-m","errorCode":null,"errorMessage":"You need at least Home Assistant version {backup_meta_version} to restore this backup","messagePattern":"You need at least Home Assistant version (.+?) to restore this backup","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"homeassistant/backup_restore.py","lineNumber":105,"sourceCode":"        TemporaryDirectory() as tempdir,\n        securetar.SecureTarArchive(\n            restore_content.backup_file_path,\n            mode=\"r\",\n        ) as ostf,\n    ):\n        ostf.tar.extractall(\n            path=Path(tempdir, \"extracted\"),\n            filter=\"tar\",\n        )\n        backup_meta_file = Path(tempdir, \"extracted\", \"backup.json\")\n        backup_meta = json.loads(backup_meta_file.read_text(encoding=\"utf8\"))\n\n        if (\n            backup_meta_version := AwesomeVersion(\n                backup_meta[\"homeassistant\"][\"version\"]\n            )\n        ) > HA_VERSION:\n            raise ValueError(\n                f\"You need at least Home Assistant version\"\n                f\" {backup_meta_version} to restore this backup\"\n            )\n\n        with securetar.SecureTarFile(\n            Path(\n                tempdir,\n                \"extracted\",\n                f\"homeassistant.tar{'.gz' if backup_meta['compressed'] else ''}\",\n            ),\n            gzip=backup_meta[\"compressed\"],\n            password=restore_content.password,\n        ) as istf:\n            istf.extractall(\n                path=Path(tempdir, \"homeassistant\"),\n                filter=\"tar\",\n            )\n            if restore_content.restore_homeassistant:","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/backup_restore.py#L87-L123","documentation":"Raised during backup restore when the backup's backup.json metadata records a Home Assistant version newer than the currently running core (compared with AwesomeVersion against HA_VERSION). Restoring would require data/schema features the running instance does not have, so it aborts before extracting homeassistant.tar.","triggerScenarios":"Restoring a backup created on a newer Home Assistant release (e.g. backup from 2025.6 restored onto 2024.12); the check runs in the restore reader right after extracting backup.json from the outer tar.","commonSituations":"Downgrading after an upgrade gone wrong, migrating a backup from a newer dev/staged instance, or restoring a backup made on a different channel (e.g. beta) into an older stable install.","solutions":["Upgrade the running Home Assistant core to at least the version printed in the message, then retry the restore","If only config (not database) is needed, extract the backup manually (tar + homeassistant.tar.gz) and copy selected YAML/.storage files into the older instance","Check the backup's backup.json homeassistant.version to confirm which release created it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from awesomeversion import AwesomeVersion\nfrom homeassistant.const import __version__ as HA_VERSION\nimport json, tarfile\n\nwith tarfile.open(\"backup.tar\") as tar:\n    meta = json.load(tar.extractfile(\"backup.json\"))\nassert AwesomeVersion(meta[\"homeassistant\"][\"version\"]) <= AwesomeVersion(HA_VERSION), \\\n    \"backup too new — upgrade core first\"","typeGuard":"def backup_is_restorable(meta: dict, running_version: str) -> bool:\n    return AwesomeVersion(meta[\"homeassistant\"][\"version\"]) <= AwesomeVersion(running_version)","tryCatchPattern":"try:\n    restore_backup(...)\nexcept ValueError as ex:\n    if \"version\" in str(ex):\n        # upgrade core, then retry the same backup","preventionTips":["Match core versions before restoring across instances","Label backups with the creating version","Never assume backward restore across major versions"],"tags":["backup","restore","version-mismatch","home-assistant"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}