| --- |
| page_title: Update Terraform state manually |
| description: >- |
| State data is the record of how real-world objects map to resources in the Terraform configuration. Learn how to manually update with state data. |
| --- |
| |
| # Update Terraform state manually overview |
| |
| This topic provides overview information about how to manually update state in Terraform. |
| |
| > **Hands-on:** Try the [Manage Resources in Terraform State](/terraform/tutorials/state/state-cli?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial. |
| |
| ## Introduction |
| |
| Terraform stores information about real-world object that correspond to resources in the configuration as [state data](/terraform/language/state). |
| Doing so allows Terraform to modify an existing object when its resource declaration changes. |
| |
| Terraform automatically updates state when you run the `terraform plan` and `terraform apply` commands, but you may need to manually adjustment state data as a result of changes to the configuration or the real managed infrastructure. |
| |
| ## Workflow |
| |
| Modifying state data outside of normal `terraform plan` or `terraform apply` operations can cause Terraform to lose track of managed resources, leading to increased costs, reduced productivity, or compromised security. Make sure to keep backups of your state data if you choose to manually modify state. |
| |
| You can use the Terraform CLI to perform the following state interations: |
| |
| - [Inspect state](/terraform/cli/state/inspect) |
| - [Re-create resources](/terraform/cli/state/taint) |
| - [Move resources](/terraform/cli/state/move) |
| - [Import existing resources](/terraform/cli/import) |
| - [Recover state from backup](/terraform/cli/state/recover) |
| |
| |