terraform init -migrate-state

The init option that copies existing state from the old backend into a newly configured one.

In more detail

Use it when you move from local state to a remote backend, or between backends. Take a backup of the state first and check the result with a plan that shows no changes.

Related terms

Taught in

References

Certification courses