Database Rollback Plan
This rollback plan is preparation only. Production is currently already on JSON, so no database rollback is needed today.
Rollback Source
Verified JSON backups remain the rollback source. chain.json, pending.json, domain JSON files, backend app-state JSON, and audit exports must be preserved during any future migration window.
Shadow Rehearsal
The PostgreSQL shadow rehearsal does not need production rollback because it never switches production storage and never writes to source JSON files. If a rehearsal fails, drop the temporary shadow database objects and keep production on JSON.
Rollback Requirements
- Keep a verified pre-migration backup archive.
- Keep the previous JSON-based deployment artifact available.
- Do not delete JSON files after cutover until parity and observation windows pass.
- Document the final JSON latest block hash and chain height before cutover.
- Confirm no private wallet keys or secrets entered database logs or reports.
Rollback Steps For A Future Cutover
- Stop database-backed writes.
- Restore the previous JSON-backed service configuration.
- Restore verified JSON files only if the active files were changed during cutover.
- Restart services and verify
/api/storage/health,/api/indexes/health,/api/readiness, and public explorer routes. - Rebuild derived indexes from JSON if needed.
- Publish an incident note if users were affected.
Never Rewrite
Never rewrite historical blocks, block hashes, transaction order, proof data, or raw historical transaction payloads while rolling back.