# Terraform: Error: Backend configuration changed — A change in the backend configuration has been detected, which may require migrating existing state

**Code:** `Backend configuration changed (migrate or reconfigure)` · **Category:** Terraform · **Seen on:** Terraform

The saved backend settings in `.terraform` differ from the current 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-config` between runs
- Cloned repo with stale `.terraform`
- Renamed state path

## Quick fix

1. Back up state: `terraform state pull > backup.tfstate`
2. `terraform init -migrate-state` to move state
3. `terraform init -reconfigure` when the new backend is already correct

## Detailed fix by platform

### Terraform

1. `terraform state pull > backup.tfstate && terraform init -migrate-state`

## How to diagnose

1. **Intent** — Move or switch?
2. **Backup** — Taken?
3. **New backend** — Has state?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/backend-configuration-changed-migrate-state)
