Migrating from Terraform
Move an existing project, safely.
Migrating an existing Terraform project to OpenTofu is usually one of the smallest “migrations” you will ever do, precisely because the config and state are compatible. The core is: install tofu, run tofu init in the existing directory, and confirm a clean plan. The care goes into version alignment and the few HashiCorp-specific integrations that do not carry over.
$ cd existing-terraform-project$ tofu init # reads the same .tf and the existing state$ tofu planNo changes. Your infrastructure matches the configuration.# a clean "no changes" plan is the signal the migration is sound
What to check
Match the OpenTofu version to a Terraform version at or above your state’s (OpenTofu forked from 1.5, so 1.5-era state migrates cleanly; if you are on a newer Terraform using features OpenTofu had not yet added, check parity first). Back up your state before switching. And inventory the HashiCorp-specific pieces: Terraform Cloud/Enterprise remote runs, Sentinel policies, and some vendor CI actions need OpenTofu equivalents (a standard backend, OPA/Conftest for policy).