{"record":{"id":"f7e5146697a6a5ce","repo":"vitessio/vitess","slug":"running-mysql-version-q-is-too-new-for-backup-mys","errorCode":null,"errorMessage":"running MySQL version %q is too new for backup MySQL version %q","messagePattern":"running MySQL version %q is too new for backup MySQL version %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/backupengine.go","lineNumber":703,"sourceCode":"\n\t// If something is across different LTS streams and not upgrade safe, we can't use it.\n\tif !parsedFrom.isSameRelease(parsedTo) {\n\t\tif !upgradeSafe {\n\t\t\tif parsedTo.atLeast(parsedFrom) {\n\t\t\t\treturn fmt.Errorf(\"running MySQL version %q is newer than backup MySQL version %q which is not safe to upgrade\", to, from)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"running MySQL version %q is older than backup MySQL version %q\", to, from)\n\t\t}\n\n\t\t// Alright, we're across different LTS streams and the backup is upgrade safe.\n\t\t// We can only upgrade to the next LTS version.\n\t\tfor i, ltsVersion := range ltsVersions {\n\t\t\tif parsedFrom.isSameRelease(ltsVersion) {\n\t\t\t\tif i < len(ltsVersions)-1 && parsedTo.isSameRelease(ltsVersions[i+1]) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif parsedTo.atLeast(parsedFrom) {\n\t\t\t\t\treturn fmt.Errorf(\"running MySQL version %q is too new for backup MySQL version %q\", to, from)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"running MySQL version %q is older than backup MySQL version %q\", to, from)\n\t\t\t}\n\t\t}\n\t\tif parsedTo.atLeast(parsedFrom) {\n\t\t\treturn fmt.Errorf(\"running MySQL version %q is newer than backup MySQL version %q which is not safe to upgrade\", to, from)\n\t\t}\n\t\treturn fmt.Errorf(\"running MySQL version %q is older than backup MySQL version %q\", to, from)\n\t}\n\n\t// At this point we know the versions are not the same, but we're withing the same version stream\n\t// and only the patch version number mismatches.\n\n\t// Starting with MySQL 8.0.35, the data dictionary format is stable for 8.0.x, so we can upgrade\n\t// from 8.0.35 or later here, also if the backup was taken with innodb_fast_shutdown=0.\n\t// This also applies for any version newer like 8.4.x.\n\tif parsedFrom.atLeast(mysql8035) && parsedTo.atLeast(mysql8035) {\n\t\treturn nil","sourceCodeStart":685,"sourceCodeEnd":721,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/backupengine.go#L685-L721","documentation":"Thrown when the backup and running versions sit in the LTS upgrade-path walk but the running version goes beyond the allowed next-LTS target. The loop found parsedFrom in ltsVersions, parsedTo is not the immediately next LTS entry, and parsedTo >= parsedFrom, so the restore is rejected as 'too new'.","triggerScenarios":"Restore where parsedFrom matches an ltsVersions entry, parsedTo is not the immediate next LTS entry (i+1), and parsedTo.atLeast(parsedFrom) — e.g. skipping an LTS by restoring an older-LTS backup onto a tablet two or more LTS streams ahead.","commonSituations":"Skipping LTS versions during upgrade (8.0 backup restored straight to a far-newer LTS); rebuilt tablet configured with a much newer mysqld than the backup.","solutions":["Restore onto a tablet running the immediately next LTS version after the backup's version, then upgrade stepwise (restore -> upgrade -> next).","Take a new backup on a version that is upgrade-safe for the desired target and restore from that.","Pin the tablet's MySQL version to one covered by the backup's upgrade path.","Plan upgrades against vitess's ltsVersions list and MySQL's supported in-place upgrade paths."],"exampleFix":"// before: 8.0.x backup restored directly onto latest 8.4/9.x -> 'too new'\n// after: restore onto next LTS first, then stepwise upgrade and re-backup","handlingStrategy":"validation","validationCode":"if skippingLTS(backupVer, runningVer) {\n    return errors.New(\"restore path skips an LTS: restore stepwise or retake backup\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never skip LTS versions during upgrades; restore/upgrade one LTS at a time.","Retake backups after each LTS upgrade step.","Plan MySQL upgrades against supported in-place upgrade paths."],"tags":["mysql","backup","restore","lts","version-compatibility"],"backgroundTag":"mysql-backup-version-incompatible","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}