State Ledger Upgrades
Safe operating procedures for state backups, schema version migrations, and transferring state ledgers between cloud backends.
Migrating Between State Backends
Section titled “Migrating Between State Backends”To migrate your state file from local storage to an AWS S3 bucket or OCI Object Storage:
- Pull Current State:
Ventana de terminal npx testform state pull > backup.state - Update
main.yml: Reconfigure thebackendblock with the target cloud provider credentials and bucket. - Initialize with State Migration:
Testform detects the legacy state and transfers all registered entities to the new backend atomically.
Ventana de terminal npx testform init -migrate-state
Backups and Disaster Recovery
Section titled “Backups and Disaster Recovery”Always retain automated snapshots prior to significant refactorings:
# Export state snapshotnpx testform state pull > state-backup-$(date +%Y%m%d).json