Migrating to Terrakube

When migrating to Terrakube you can use the following approaches:

Migrating with the Terraform CLI

  1. Begin by downloading the current state from Terraform Cloud / Enterprise with the following command:

terraform state pull > tf.state
  1. Proceed to modify your Terraform configuration to introduce Terrakube as the replacement cloud backend. It's crucial to include the hostname parameter:

terraform {
  backend "remote" {
    hostname = "8080-azbuilder-terrakube-q8aleg88vlc.ws-us92.gitpod.io"
    organization = "migrate-org"

    workspaces {
      name = "migrate-state"
    }
  }
}
  1. And run the following commands

terraform login 8080-azbuilder-terrakube-q8aleg88vlc.ws-us92.gitpod.io
terraform init 
terraform state push tf.state

Once the migration process is completed you should see the terraform state in your storage backend (azure, aws, gcp or minio) depending of your configuration

Migrating with the Workspaces Importer

To begin migrating your workspaces using the Workspace Importer within Terrakube, follow these steps:

  1. Navigate to the Workspaces List within your organization and click on "Import Workspaces".

  1. Select Your Platform: Choose the platform where your workspaces are currently hosted. Terrakube currently supports both Terraform Cloud and Terraform Enterprise.

  1. Choose Your Workflow: Decide on the workflow type you wish to use for the import. If you need to import from multiple workflows, you will need to execute the importer for each one separately.

  1. Configure VCS Workflow (If Applicable): For a Version control workflow, select your VCS provider connection. For guidance on connecting your VCS provider, refer to the VCS provider section.

  1. Enter API Keys: Provide your Terraform Cloud or Terraform Enterprise API keys. For Terraform Enterprise, you will also need to supply your host URL. For more information, consult the Terraform Cloud documentation.

  1. Select Workspaces for Import: A list of available workspaces will be displayed. Select the ones you wish to import and then click the "Import Workspaces" button.

  1. Import Process: The importer will replicate workspace details such as name, description, Terraform version, execution mode, variables, tags and the current state into Terrakube.

  1. Once the import process is finished, you can view the imported workspaces in Terrakube.