Terraform
Recover state from backup overview
This topic provides overview information about recovering Terraform state from a backup after a disaster, such as an accident when performing other state manipulation actions.
Workflow
Unlock Terraform: You may need to unlock Terraform when a
terraform apply
or other process unexpectedly terminates before Terraform can release its lock on the state backend. Unlocking Terraform overrides protectionsthat prevent two processes from modifying state at the same time. We do not recommend unlocking until you determine what caused the lock to get stuck.Refer to the
terraform force-unlock
command documentation for additional information.Read state data: Run the
terraform state pull
command to read the state files from the configured backend.Write state data: Run the
terraform state push
command to write state files to the configured backend.