Skip to content

State Ledger Upgrades

Safe operating procedures for state backups, schema version migrations, and transferring state ledgers between cloud backends.

To migrate your state file from local storage to an AWS S3 bucket or OCI Object Storage:

  1. Pull Current State:
    Ventana de terminal
    npx testform state pull > backup.state
  2. Update main.yml: Reconfigure the backend block with the target cloud provider credentials and bucket.
  3. Initialize with State Migration:
    Ventana de terminal
    npx testform init -migrate-state
    Testform detects the legacy state and transfers all registered entities to the new backend atomically.

Always retain automated snapshots prior to significant refactorings:

Ventana de terminal
# Export state snapshot
npx testform state pull > state-backup-$(date +%Y%m%d).json