A `moved` block from `null_resource.bootstrap` to `terraform_data.bootstrap` fails with a resource type mismatch on an old Terraform version.
AdvancedTroubleshootingImport, Already Exists and State Surgery
Answer
Likely causes → Cross-type moves need Terraform 1.8+ and provider support. null_resource → terraform_data is supported from 1.9; older versions reject any move between different types.
Diagnose → terraform version locally and in CI.
Fix → Upgrade to 1.9+ everywhere and keep the moved block. On older versions, use removed { lifecycle { destroy = false } } plus a new terraform_data (which will re-run its provisioner) or accept the replacement.
Prevent → Check the minimum Terraform version for refactor features and bump required_version in the same PR.
More on Import, Already Exists and State Surgery
Apply fails with `EntityAlreadyExists: Role with name app-role already exists.`Beginner`terraform apply` on a new bucket fails with `BucketAlreadyExists`. You have never created that bucket.Beginner`Error: Resource already managed by Terraform` when running `terraform import aws_s3_bucket.logs acme-logs`.Beginner`Error: Cannot import non-existent remote object` for a resource you can see in the console.Intermediate`Error: Configuration for import target does not exist` when running `terraform plan` with an `import` block.Beginner`terraform plan -generate-config-out=generated.tf` fails with `Conflicting configuration arguments` in the generated file.Intermediate