How to migrate a Terraform workspace's backend github Enterprise repository to github.com

Hello, we are planning to migrate the TF file repositories from GitHub on-premise enterprise server to github.com. These repositories are tagged to individual Terraform enterprise workspaces.
Can anyone please guide me on how to handle this migration so that:

  1. after repository migration TFE workspaces can be re tagged to new github repository url.
  2. Terraform state file managed in terraform cloud should works even after repository migration

Hi @nandy.deba,

Because you are a Terraform Enterprise customer, I suggest contacting the HashiCorp support team rather than relying on this forum. The support team can typically give more specific guidance than participants in this forum.

Terraform does not “remember” the source locations of modules in the state, and instead tracks resource instance addresses only using the names you choose in the code. Therefore you shouldn’t need to do anything special with Terraform state if all you’ve done is moved the same module to a new source location. As long as the code is still the same (apart from the source addresses themselves) after installation Terraform will treat the desired state as unchanged, and should therefore propose no changes.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.