website/docs/intro/upgrading.mdx
OpenTofu 1.11.x is mostly compatible with previous OpenTofu versions. This migration guide will take you through the process of upgrading OpenTofu to version 1.11.0.
Although OpenTofu 1.11 is mostly compatible with previous versions, you should take the necessary precautions to prevent accidents. Make sure you have an up to date and tested disaster recovery plan.
Before proceeding, make sure that you apply all changes with tofu apply. Running tofu plan should result in no planned changes. While you can switch to OpenTofu with pending changes, it is not recommended.
$ tofu plan
...
No changes. Your infrastructure matches the configuration.
OpenTofu has compared your real infrastructure against your
configuration and found no differences, so no changes are needed.
As a first step, please follow the installation instructions for the OpenTofu CLI tool. Please test
if you can successfully execute the tofu command and receive the correct version:
$ tofu --version
OpenTofu v1.11.0
on linux_amd64
Before you begin using the tofu binary on your Terraform code, make sure to back up your state file. If you are using
a local state file, you can simply make a copy of your terraform.tfstate file in your project directory.
If you are using a remote backend such as an S3 bucket, make sure that you follow the backup procedures for the backend and that you exercise the restore procedure at least once.
:::warning
Should any of the following steps fail, please do not proceed and follow the rollback instructions below instead. If you suspect the failure may be the result of a bug in OpenTofu, please help us by opening an issue.
:::
Now you are ready to migrate. Run tofu init in the directory where your code resides. OpenTofu will download
any providers and modules referenced in your configuration from the OpenTofu registry.
:::note
If you are using the S3 backend - You will need to run tofu init -reconfigure to reinitialize the backend.
:::
Once initialized, run tofu plan and ensure that there are no pending changes similar to step 1 above. If there are
unexpected changes in the plan, roll back to OpenTofu 1.8.x/1.9.x/1.10.x and troubleshoot your migration. (See the Troubleshooting
section below.)
$ tofu plan
...
No changes. Your infrastructure matches the configuration.
OpenTofu has compared your real infrastructure against your
configuration and found no differences, so no changes are needed.
Before you begin using OpenTofu for larger changes, test out tofu apply with a smaller, non-critical
change.
If you have issues migrating to OpenTofu you can follow these steps to roll back to OpenTofu 1.8.x/1.9.x/1.10.x:
tofu init.tofu plan and verify that no unexpected changes are in the plan.If you encountered a bug, please report it on GitHub.
If you encounter any issues during the migration to OpenTofu, you can join the <a href="/slack/">OpenTofu Slack</a> or ask on GitHub Discussions.
This error happens when a provider you specified in your configuration is not available in the OpenTofu registry. Please roll back to OpenTofu 1.8.x/1.9.x/1.10.x and make sure your code works with that version. If your code works, please submit an issue to include the provider in the registry.
This error happens when a module you specified in your configuration is not available in the OpenTofu registry. Please roll back to OpenTofu 1.8.x/1.9.x/1.10.x and make sure your code works with that version. If your code works, please submit an issue to include the module in the registry.