Introduction
Terraform Enterprise standalone installations operate on a single instance, while Terraform Enterprise clustered installations are spread across separate nodes. As clustering becomes more available, there is a need to migrate existing data from standalone installations to a new cluster.
Use Case
This document details the process of migrating existing data from a standalone installation to a newly configured clustered installation.
Procedure
External Services
If the existing environment is using external services, the existing database and blob store can be connected to a new clustered installation. For this process, the Terraform Enterprise application should be stopped before the cluster is started. If a database and blob store are attached to two running instances of Terraform Enterprise at once, they can become irreparably damaged.
Notably, the Encryption Password that is set on the individual installation must match the encryption password that is set on the clustered installation.
Backup and Restore API
Another option for migrating data is to use the Backup and Restore API (only available in v202001-1
and later).
As this method allows for migrating between storage configurations, this is the only way to migrate from Mounted Disk within the standalone installation to External Services on the clustered installation.
State Migration Only
At times, it may be preferable to only migrate the current state files between the instances, rather than the entire data set; including previous state files, configuration versions, policies, etc. To explore this option, please refer to the steps outlined in Learn: Migrate State to Terraform Cloud. While this Learn guide is targeted at Terraform Cloud, the same process may be used by setting a hostname
value for the remote
backend.