Introduction
Terraform Enterprise can be deployed in a standalone installation on a single instance or in a clustered installation spread across multiple nodes. This guide outlines the process for migrating existing data from a standalone installation to a new clustered environment.
Use Case
This document details the procedures for migrating existing data from a standalone Terraform Enterprise installation to a newly configured clustered installation.
Migration Approaches
There are several methods to migrate your data, depending on your existing infrastructure and migration goals.
Approach 1: Reconnect External Services
If your existing standalone environment uses external services for its database and blob storage, you can connect them to the new clustered installation.
To perform this migration, you must stop the Terraform Enterprise application on the standalone instance before starting the new cluster. Attaching a database and blob store to two running instances of Terraform Enterprise simultaneously can cause irreparable data corruption.
Additionally, the Encryption Password set on the standalone installation must match the encryption password configured on the new clustered installation.
Approach 2: Use the Backup and Restore API
Another option for migrating data is to use the Backup and Restore API, which is available in Terraform Enterprise v202001-1 and later.
This method is the only supported way to migrate from a Mounted Disk storage configuration on the standalone installation to an External Services configuration on the clustered installation, as it allows for migrating between different storage backends.
Approach 3: Migrate Terraform State Only
You may prefer to migrate only the current state files between instances, rather than the entire dataset which includes previous state versions, configuration versions, and policies.
To explore this option, refer to the steps outlined in the Migrate State to Terraform Cloud guide. While this guide is targeted at HCP Terraform, you can adapt the same process for Terraform Enterprise by setting a hostname value for the remote backend in your configuration.