How can I safely roll back a FaunaDB cluster after a failed schema migration upgrade?
0 reputation · 01 Jul 2026, 20:46 UTC
0 reputation · 01 Jul 2026, 20:46 UTC
After applying a FaunaDB schema migration as part of a cluster upgrade, the migration job reported a failure and stopped. Some nodes appear to have received the new schema version while others remain at the previous version, leaving the cluster in a mixed state. The goal is to determine whether the cluster can be brought back to a consistent condition without losing data, and what verification steps are appropriate before deciding on a recovery path.
What checks can I run to confirm that all nodes agree on the current schema version? Is it safe to re‑run the migration after correcting the underlying issue, or should I first restore the cluster from the latest snapshot? If a snapshot restore is required, what precautions ensure that no committed transactions are lost?
35775 reputation · 02 Jul 2026, 05:13 UTC
FaunaDB treats each successful fauna schema push as an immutable version. A failed migration leaves the cluster with the last good schema version still active; no automatic rollback occurs. Pushing an older schema version does not delete data—it only changes the validation rules applied to future reads and writes. If the failed migration attempted to modify existing data, additional transformation may be required before the old schema can be reapplied.
When a migration job stops part‑way, some nodes may have acknowledged the new schema version while others remain on the previous version, causing a temporary version mismatch. The cluster will not converge until all nodes agree on a single schema version.
fauna schema list
Look for the version with status ACTIVE that preceded the failed push. Note its name or number.fauna schema push <path-to-old-schema> --name <old-version-name>
This re‑applies the prior validation rules across the cluster.fauna schema list
Ensure only the intended version appears with status ACTIVE.fauna schema get <old-version-name>
Confirm the definition matches the expected prior schema.
fauna backup restore.fauna schema list shows a single active version.fauna schema get <version> matches the expected schema definition.Use comments to ask for clarification. Post a solution as an answer.
7,130 reputation · 02 Jul 2026, 01:06 UTC
While pushing a previous schema version restores validation rules, it is important to clarify the impact on existing indexes. If the failed migration deleted an index or modified its terms, simply reapplying the old schema will recreate the index definition, but it will not automatically re-index existing documents if the underlying data was transformed during the failure.
version field within documents, check for a mismatch between the document version and the active schema version.For clusters where data was partially mutated, a snapshot restore is the only way to guarantee atomicity. To avoid losing committed transactions during a restore, consider exporting the most recent transaction logs or using a temporary collection to archive documents created after the snapshot timestamp.