Compare OpenTofu and Terraform post-BSL license change. What are the technical differences, migration considerations, and how do you advise an organization currently using Terraform Cloud?
Quick Answer
OpenTofu is an MPL-2.0 fork of Terraform that maintains API compatibility but diverges on features like client-side state encryption, early variable evaluation, and provider-defined functions. Migration is straightforward for CLI users but complex for Terraform Cloud users who need alternatives like Spacelift, env0, or self-hosted backends.
Detailed Answer
License Context
HashiCorp changed Terraform's license from MPL-2.0 to BSL 1.1 in August 2023. BSL allows free use but prohibits competing commercial offerings. OpenTofu (Linux Foundation) forked from the last MPL-licensed version (1.5.x) and has since diverged with independent features.
Technical Differences (as of 2025-2026)
1. State encryption: OpenTofu supports client-side state encryption natively (AES-GCM with key providers for AWS KMS, GCP KMS, etc.). Terraform doesn't offer this. 2. Early variable/local evaluation: OpenTofu evaluates variables and locals earlier in the lifecycle, allowing them in backend configuration and module sources. 3. Provider-defined functions: Both support this (Terraform since 1.8, OpenTofu since 1.7), but implementations differ slightly. 4. Registry: OpenTofu uses its own registry (registry.opentofu.org) but supports pulling from the Terraform registry. 5. Removed features: OpenTofu removed cloud/remote backend integration with Terraform Cloud.
Migration Considerations
- State file compatibility: OpenTofu reads Terraform state files (both directions up to format version 4). However, if either tool adds new state features, forward compatibility may break. - Provider compatibility: All existing Terraform providers work with OpenTofu unchanged. - HCL compatibility: Core HCL syntax is identical. Module code requires no changes for migration. - CI/CD changes: Replace terraform binary with tofu, update pipeline scripts.
Terraform Cloud Migration
This is the hardest part. Options: - Spacelift: Full-featured, supports both Terraform and OpenTofu, strong policy engine - env0: Good for cost management, environment-as-a-service model - Scalr: Hierarchical policy management - Self-hosted: Atlantis (PR-based) + S3/GCS backend + OPA for policy - HCP Terraform (renamed Terraform Cloud): If BSL is acceptable, stay put