Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When you try to do it out of the box, you get this error: ``` Initializing the backend... Migrating from Terraform Cloud to s3 state. ╷ │ Error: Migrating state from Terraform Cloud to another backend is not yet implemented. │ │ Please use the API to do this: https://www.terraform.io/docs/cloud/api/state-versions.html ``` The instructions on that page are not every helpful. Luckily this fine fellow on the internet tells us how to do it here: https://nedinthecloud.com/2022/03/03/migrating-state-data-off-terraform-cloud/ tl;dr is to do this: 1. `terraform init` with the cloud provider 2. `mkdir -p terraform.tfstate.d/tfc-migration-test` 3. `terraform state pull > terraform.tfstate.d/production-tier1/terraform.tfstate` 4. `mv .terraform/terraform.tfstate .terraform/terraform.tfstate.old` 5. Drop the cloud section of the terraform provider and replace it with s3 6. `terraform init`
- Loading branch information