Terraform: Error: Backend configuration changed — A change in the backend configuration has been detected, which may require migrating existing state
The saved backend settings in .terraform differ from the current configuration.
Error: Backend configuration changedA change in the backend configuration has been detected, which may require migrating existing stateIf you wish to attempt automatic migration of the state, use "terraform init -migrate-state"If you wish to store the current configuration with no changes to the state, use "terraform init -reconfigure"Error: Backend configuration changed A change in the backend configuration Meaning
Choose: terraform init -migrate-state to copy existing state to the new backend (interactive confirmation) or terraform init -reconfigure to ignore the old config without migrating (you must be sure the new location already has the right state). Wrong choices can orphan or overwrite state — back up first (terraform state pull > backup.tfstate).
Common causes
- Changed bucket/key/region/workspace prefix
- Switched from local to remote backend
- Different
-backend-configbetween runs - Cloned repo with stale
.terraform - Renamed state path
⚡ Quick fix
- Back up state:
terraform state pull > backup.tfstate terraform init -migrate-stateto move stateterraform init -reconfigurewhen the new backend is already correct
Detailed fix by platform
Terraform
terraform state pull > backup.tfstate && terraform init -migrate-state
How to diagnose
- Intent — Move or switch?
- Backup — Taken?
- New backend — Has state?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Backend initialization required Terraform: Error: Backend initialization required, please run "terraform init" — Reason: Initial configuration of the requested backend "s3"
- Cannot import non-existent remote object Terraform: Error: Cannot import non-existent remote object — While attempting to import an existing object to "aws_s3_bucket.logs", the provider detected that no object exists with the given id
- DynamoDB lock table not found (ResourceNotFoundException) Terraform: Error: Error acquiring the state lock: ResourceNotFoundException: Requested resource not found / failed to retrieve lock info
Most viewed in Terraform
- Inconsistent dependency lock file Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected
- Reference to undeclared resource Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable
- Error building ARM Config: obtain subscription from Azure CLI Terraform: Error: building AzureRM Client: obtaining subscription ID / Please run 'az login' to setup account
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026