{"record":{"id":"01cf571d4fe800af","repo":"clockworklabs/SpacetimeDB","slug":"metadata-toml-at-indicates-that-this-database-i","errorCode":null,"errorMessage":"metadata.toml at {} indicates that this database is from a different edition of SpacetimeDB (running {:?}, but this database is {:?})","messagePattern":"metadata\\.toml at (.+?) indicates that this database is from a different edition of SpacetimeDB \\(running (.+?), but this database is (.+?)\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/core/src/config.rs","lineNumber":66,"sourceCode":"            current_version.patch = 0;\n        }\n        Self {\n            version: current_version,\n            edition: edition.to_owned(),\n            client_connection_id: None,\n        }\n    }\n\n    pub fn read(path: &MetadataTomlPath) -> anyhow::Result<Option<Self>> {\n        parse_config(path.as_ref())\n    }\n\n    pub fn write(&self, path: &MetadataTomlPath) -> io::Result<()> {\n        path.write(self.to_string())\n    }\n\n    fn check_compatibility(previous: &Self, current: &Self, metafile: &Path) -> anyhow::Result<()> {\n        anyhow::ensure!(\n            previous.edition == current.edition,\n            \"metadata.toml at {} indicates that this database is from a different \\\n            edition of SpacetimeDB (running {:?}, but this database is {:?})\",\n            metafile.display(),\n            current.edition,\n            previous.edition,\n        );\n\n        // This is mostly redundant with the caret comparison below, but\n        // pre-releases make it annoying.\n        if previous.version == current.version {\n            return Ok(());\n        }\n\n        // Special-case: SpacetimeDB 2.x can run 1.x databases.\n        if previous.version.major == 1 && current.version.major == 2 {\n            return Ok(());\n        }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/fb7282411b0b73cc68d51e161f180cd409abd851/crates/core/src/config.rs#L48-L84","documentation":"During database bootstrap, metadata.toml beside the database is compared with the running server's edition via check_compatibility; differing editions abort opening the database. The edition is a coarse compatibility marker between SpacetimeDB release lineages — on-disk state written by one lineage is refused by the other, which is what this error reports (running edition vs database edition).","triggerScenarios":"Starting or using a database whose data directory was created by a different SpacetimeDB edition: downgrading the server binary, restoring an old backup into a newer install, or pointing the server at state from another edition.","commonSituations":"Downgrading after trying a new release; copying data directories between environments on different versions; long-lived databases carried across breaking releases; restoring snapshots.","solutions":["Run the server version whose edition matches the database (both editions are printed in the error; check metadata.toml to confirm)","If the data is disposable, delete the database (`spacetime delete <db>` or remove its directory) and re-publish fresh","If upgrading was intended, follow the documented upgrade path — upgrade the binary first and never downgrade below the edition that wrote the state"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# bash: compare the database's edition against the running binary before start\nEDITION=$(grep -E '^edition' /path/to/db/metadata.toml)\necho \"db: $EDITION ; binary: $(spacetime version)\"   # abort if lineages differ","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never downgrade a server below the edition that wrote the databases it hosts","Record the creating version in runbooks when restoring backups, and match binaries to it","Treat disposable dev databases as re-publishable rather than portable across editions"],"tags":["version-mismatch","storage","server","upgrade"],"backgroundTag":"version-edition-mismatch","analyzedSha":"fb7282411b0b73cc68d51e161f180cd409abd851","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}