---
title: "Switch from Terraform to OpenTofu: what changes, what breaks · CloudSat"
description: "Moving from Terraform to OpenTofu? Licensing, how far the tools have drifted by OpenTofu 1.13, a migration with a real rollback, and when to stay put."
url: https://cloudsat.io/learn/switch-from-terraform-to-opentofu
updated: 2026-11-18T12:00:00Z
source: CloudSat (https://cloudsat.io/). Prices in USD.
---

[DevOps](https://cloudsat.io/learn/topic/devops-and-automation)

# Switch from Terraform to OpenTofu: what changes, what breaks

Moving from Terraform to OpenTofu? Licensing, how far the tools have drifted by OpenTofu 1.13, a migration with a real rollback, and when to stay put.

CloudSat team November 18, 2026 7 min read

OpenTofu exists because Terraform changed its license. HashiCorp announced in August 2023 that Terraform would ship under the Business Source License 1.1 from version 1.6 on; in response, a coalition of vendors and individual contributors took the final MPL-licensed code and forked it as OpenTofu, which is now a Linux Foundation project and keeps the MPL-2.0 license. Three years on, the two tools still read the same HCL and talk to the same providers, but their feature lists have drifted apart. As of November 2026, OpenTofu's current series is 1.13 and Terraform's is 1.17.

The useful question is not which tool is better. It is what you would gain by switching, what would break, and how to keep a way back.

## The license question in one paragraph

The Business Source License allows you to use Terraform in production, including inside a company, but its additional use grant excludes offering it as part of a product that competes with HashiCorp's own. For most teams that only manage their own infrastructure, that is not a blocker. It matters to vendors that build platforms on top of Terraform, and to organizations whose policy accepts only open-source licenses. MPL-2.0 has no such restriction, and OpenTofu's governance does not depend on a single company.

## How far the two have drifted

Each project now ships features the other lacks, and some features get ported later, so check the current documentation of both before relying on a difference. The milestones that started in OpenTofu:

| OpenTofu release | Date | Headline features |
| --- | --- | --- |
| 1.7 | April 2024 | Client-side state and plan encryption, provider-defined functions |
| 1.8 | July 2024 | Early evaluation (variables in backend and module source blocks), provider mocking in tests, `.tofu` files |
| 1.9 | January 2025 | Provider `for_each`, the `-exclude` planning flag |
| 1.10 | June 2025 | OCI registries for providers and modules, native S3 state locking, OpenTelemetry tracing |
| 1.11 | December 2025 | Ephemeral resources and write-only attributes, `enabled` for resources and modules |
| 1.12 | May 2026 | Dynamic `prevent_destroy`, a `destroy` lifecycle argument |
| 1.13 | September 2026 | Windows on ARM64 builds, symbol libraries and linting as experiments |

On the Terraform side, the largest differences are around HCP Terraform: remote runs, Sentinel policies, Stacks and the private registry live in HashiCorp's service, and none of them move with the CLI. Terraform 1.14 also introduced actions and list resources for querying existing infrastructure, which OpenTofu configurations cannot use.

## Take inventory first

Answer four questions before touching a binary:

1. **Which Terraform version and features do you use?** Code written for Terraform 1.5 or earlier moves with few surprises. Newer Terraform-only syntax fails at `tofu init` or `tofu validate`, which is a cheap way to find out.
2. **Where do runs happen?** A laptop or a CI job changes one binary. HCP Terraform workspaces mean replacing remote runs, policies and variable sets with your own CI, Atlantis or another automation service that supports OpenTofu.
3. **Where are modules and state?** Public providers and modules resolve through the OpenTofu registry. Private modules in HCP's registry need a new home, such as Git tags or an OCI registry. State kept in HCP Terraform should move to a backend you control first: S3-compatible storage, GCS, Azure Blob Storage or PostgreSQL all work in both tools.
4. **What else calls `terraform`?** Wrappers, pre-commit hooks, Makefiles and CI images. Terragrunt and Atlantis can both run OpenTofu once configured to.

Configurations that read each other's outputs through `terraform_remote_state` need extra care: migrate them in dependency order, as OpenTofu's guide for interdependent configurations explains.

## The migration, with a way back

Work in a branch, freeze other changes for the duration, and keep a copy of every state file you are about to touch. For remote backends, turn on object versioning as well.

```bash
# 1. keep a copy of the current state
terraform state pull > pre-tofu-$(date +%F).tfstate

# 2. install OpenTofu (Debian or Ubuntu; other systems have packages too)
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
chmod +x install-opentofu.sh
./install-opentofu.sh --install-method deb
rm -f install-opentofu.sh
tofu version

# 3. initialize and compare
tofu init
tofu plan -out=switch.plan
```

`tofu init` downloads providers from the OpenTofu registry and updates `.terraform.lock.hcl`; since 1.12 it also adds `h1:` hashes to existing entries. Commit the updated lock file.

The plan should say "No changes", or match exactly what Terraform would have planned. If it shows anything unexpected, stop and investigate rather than applying. When it is clean, apply it once anyway, even with no changes, so OpenTofu can update the state's format if it needs to, then prove the pipeline with a harmless change such as a tag:

```bash
tofu apply switch.plan
```

**Rollback** is straightforward at this stage: stop using `tofu`, restore the state copy if anything was written, run `terraform init` and `terraform plan`, and confirm no unexpected changes. Keep that door open until the team trusts the new setup.

## What actually breaks

- **Unexpected diffs in the first plan.** Usually a provider resolved to a different version. Pin provider versions in `required_providers` and compare the lock file before and after.
- **Terraform-only blocks.** Anything introduced by Terraform after the fork that OpenTofu does not implement fails validation. Rewrite it, or keep that configuration on Terraform.
- **Policy as code.** Sentinel policies do not run outside HCP Terraform. Open Policy Agent with Conftest, run in CI against `tofu show -json` output, is the usual replacement.
- **WinRM provisioners.** OpenTofu 1.12 deprecated `type = "winrm"` in connection blocks and 1.13 removed it. Move Windows provisioning to OpenSSH, or better, to images built ahead of time.
- **Platform support.** OpenTofu 1.13 requires macOS 13 or later and is the last series with official 32-bit builds.

## Adopt OpenTofu-only features last

State encryption is the feature that most often motivates a switch, and it is also one-way: Terraform cannot read state that OpenTofu has encrypted. Turn it on only after you have committed to OpenTofu. The `fallback` block below lets OpenTofu read the existing unencrypted state once and write it back encrypted:

```hcl
terraform {
  encryption {
    key_provider "pbkdf2" "main" {
      passphrase = var.state_passphrase   # at least 16 characters, never committed
    }
    method "aes_gcm" "main" {
      keys = key_provider.pbkdf2.main
    }
    method "unencrypted" "migrate" {}

    state {
      method = method.aes_gcm.main
      fallback {
        method = method.unencrypted.migrate
      }
    }
  }
}
```

After the first successful apply, remove the fallback so unencrypted state is refused from then on. Lose the passphrase and you lose the state, so store it in your secrets manager before anything else.

## Should you switch?

**Switch** when you want state encryption, provider `for_each`, OCI-hosted modules or an open-source license, and your runs already happen in CI rather than in HCP Terraform.

**Stay** when your workflow depends on HCP Terraform features, on Terraform-only syntax from recent releases, or on a support contract with HashiCorp. Staying is a reasonable choice; the point is to make it deliberately.

Either way, give the tool a permanent home. A small server makes a good runner: credentials stay on one machine and providers can allowlist its static IP. On CloudSat, the [Terraform one-click app](https://cloudsat.io/apps/deploy-terraform) starts with Terraform installed, and the installer above adds `tofu` beside it while you migrate.

## FAQ

### Can Terraform and OpenTofu share one state file?

They read the same format today, but alternating between them on one state invites subtle problems, and encryption ends the compatibility entirely. Pick one tool per repository and switch each repository once.

### Do I have to rename my .tf files?

No. OpenTofu reads `.tf` files as they are. A `.tofu` file is optional: when `main.tofu` sits next to `main.tf`, OpenTofu uses the `.tofu` version, which lets one repository serve both tools during a transition.

### Is OpenTofu mature enough for production?

It has shipped seven minor releases between April 2024 and September 2026, with regular patch releases in between, and it runs the same providers as Terraform. Treat it like any infrastructure tool: pin versions, read release notes and test upgrades on a non-critical stack first.

**Run it on CloudSat.** Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. [See plans](https://cloudsat.io/plans) or [deploy a server](https://dash.cloudsat.io/console/deploy).

## Keep reading

[All guides in DevOps](https://cloudsat.io/learn/topic/devops-and-automation)

- [A self-hosted developer stack on one VPS: layout and limits](https://cloudsat.io/learn/developer-tool-stack-on-one-vps): Self-hosting A self-hosted developer stack on one VPS: layout and limits 6 min read
- [Move off GitHub without breaking builds, links or history](https://cloudsat.io/learn/move-repositories-off-github): DevOps Move off GitHub without breaking builds, links or history 6 min read
- [Deploy microservices on a few servers without Kubernetes](https://cloudsat.io/learn/deploy-microservices-on-a-few-servers): DevOps Deploy microservices on a few servers without Kubernetes 6 min read
- [Remote Docker builds over SSH: use a VPS as your engine](https://cloudsat.io/learn/remote-docker-builds-over-ssh): DevOps Remote Docker builds over SSH: use a VPS as your engine 7 min read
