{"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":null,"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/524b4487d949b61a07d4f39c862d1290259dfd20/crates/core/src/config.rs#L48-L84","documentation":"Every database records an edition field in its metadata.toml; on open, the node compares it with the running build's edition and refuses to proceed when they differ. This guards against reading on-disk state written by a different edition of SpacetimeDB, whose storage formats are not interchangeable.","triggerScenarios":"Pointing a server binary built for one edition at a data directory created by another edition; restoring a backup taken from a deployment running a different edition; switching container images across editions while keeping the data volume.","commonSituations":"Mixing binaries or images from different distributions; copying data dirs between environments; edition identifiers changing between versions of the product.","solutions":["Run the same edition that created the database — read the edition value from <data-dir>/<db>/metadata.toml.","Re-publish the module into a fresh database created by the current edition.","If the data is disposable, delete the database directory and start clean.","Contact SpacetimeDB support if the on-disk data must be migrated across editions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# before starting a server against an existing data dir\nMETA=\"$DATA_DIR/<database>/metadata.toml\"\nif [ -f \"$META\" ]; then\n  db_edition=$(grep -oP 'edition\\s*=\\s*\"\\K[^\"]+' \"$META\")\n  [ \"$db_edition\" = \"$RUNNING_EDITION\" ] || { echo \"data dir is edition '$db_edition', binary is '$RUNNING_EDITION'\" >&2; exit 1; }\nfi\nexec spacetime start --data-dir \"$DATA_DIR\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Label every backup with the edition and version that wrote it.","Never mix edition binaries against a shared data volume.","Pin the exact edition in deployment manifests and change it deliberately."],"tags":["spacetimedb","metadata","edition","database","startup","compatibility"],"backgroundTag":"database-edition-mismatch","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}