Skip to content

Commit f2aed6b

Browse files
Updates to the "Migrate to HCP Terraform" overview page (#904)
1 parent 33967af commit f2aed6b

File tree

1 file changed

+8
-10
lines changed
  • content/terraform-docs-common/docs/cloud-docs/migrate

1 file changed

+8
-10
lines changed

content/terraform-docs-common/docs/cloud-docs/migrate/index.mdx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
page_title: Migrate Terraform state to HCP Terraform or Terraform Enterprise
33
description: >-
4-
Learn how to migrate existing Terraform state to HCP Terraform or Terraform Enterprise so that you can manage
5-
existing infrastructure without de-provisioning.
4+
Learn how to migrate existing Terraform state to HCP Terraform or Terraform Enterprise using the CLI, API, or tf-migrate.
65
---
76

87
# Migrate Terraform state to HCP Terraform or Terraform Enterprise
@@ -14,13 +13,13 @@ This topic describes how to migrate existing Terraform state files to HCP Terraf
1413
Perform the following actions to migrate existing resources to one or more workspaces in HCP Terraform or Terraform Enterprise:
1514

1615
1. Stop all Terraform operations associated with the state files.
17-
1. Migrate Terraform state files using either the Terraform CLI or the HCP Terraform or Terraform Enterprise API.
16+
1. Migrate Terraform state files to HCP Terraform or Terraform Enterprise.
1817

1918
You have three options to migrate your state:
2019

2120
1. Manually using the Terraform CLI
22-
1. Automatically using `tf-migrate`
2321
1. Manually using the HCP Terraform API
22+
1. Automatically using `tf-migrate`
2423

2524
## Requirements
2625

@@ -60,10 +59,6 @@ Stop all Terraform operations associated with the state files. This may require
6059

6160
1. Run `terraform init`. Terraform creates any workspaces specified in the configuration if they do not already exist in the organization.
6261

63-
## Migrate state using Terraform migrate
64-
65-
You can use the Terraform migrate CLI tool to automatically migrate state to HCP Terraform and Terraform Enterprise. The tool does not ship with HCP Terraform. You must download and install the binary for the CLI tool separately. Refer to the [Terraform migrate documentation](/terraform/migrate) for more information.
66-
6762
## Migrate state using the API
6863

6964
1. Encode your state files as a base64 string and generate an MD5 hash. The following example generates the string and hash file for a single `terraform.tfstate` file:
@@ -89,6 +84,9 @@ You can use the Terraform migrate CLI tool to automatically migrate state to HCP
8984
Refer to the following external article for an example of how to create a script in Python to automate multiple state files:
9085
[Migrating A Lot of State with Python and the HCP Terraform (previously Terraform Cloud) API](https://medium.com/hashicorp-engineering/migrating-a-lot-of-state-with-python-and-the-terraform-cloud-api-997ec798cd11). The example uses the [Workspaces API](/terraform/cloud-docs/api-docs/workspaces#create-a-workspace) to create the necessary workspaces in HCP Terraform and the [State Versions API](/terraform/cloud-docs/api-docs/state-versions) to migrate the state files to those workspaces.
9186

92-
## Migrate state using Terraform migrate
9387

94-
You can use the Terraform migrate CLI tool to automatically migrate state to HCP Terraform and Terraform Enterprise. The tool does not ship with HCP Terraform. You must download and install the binary for the CLI tool separately. Refer to the [Terraform migrate documentation](/terraform/cloud-docs/migrate/tf-migrate) for more information.
88+
## Migrate state using `tf-migrate`
89+
90+
> **Hands-on:** Complete the [Migrate to HCP Terraform in bulk](/terraform/tutorials/cloud/bulk-migrate-hcp) tutorial to get started with tf-migrate.
91+
92+
You can use the `tf-migrate` CLI tool to automatically migrate state to HCP Terraform and Terraform Enterprise. The tool does not ship with HCP Terraform. You must download and install the binary for the CLI tool separately. Refer to the [`tf-migrate` documentation](/terraform/migrate) for more information.

0 commit comments

Comments
 (0)