Migrating from disk to external mode
You must choose an operational mode before you install and deploy Terraform Enterprise. To change the operational mode, you must backup the data of your Terraform Enterprise installation and restore it to a new one. If you currently use the disk
operational mode and are migrating to a non-Replicated runtime other than disk
mode on Docker, you must first migrate to external
mode.
Create a Backup
To create a backup, retrieve the backup API token from your Terraform Enterprise installation's settings page. Store this token in an environment variable.
Next, create a file named payload.json
that includes your Terraform Enterprise encryption password.
Optionally, if you have a large number of objects in storage which is causing your backup to become very large, you can skip the backup of the object storage by adding the skip_object_storage
field to the payload.json
file.
Finally, create the an encrypted backup file named backup.blob
in the current directory.
Prepare the New environment
Create a new Terraform Enterprise installation. The new installation must meet the following requirements:
- The
TFE_OPERATIONAL_MODE
configuration must be set toexternal
oractive-active
. - It is configured with the same encryption password as the instance that you created the backup from.
- The PostgreSQL database version matches the version your mounted disk installation uses.
Restore the Backup
Retrieve the backup API token from your new Terraform Enterprise installation's settings page. Store this token in an environment variable.
Use the same payload.json
and backup.blob
files to restore the backup.
Upload to Object Store (Optional)
If you set skip_object_storage
to true in your payload.json
file, you must separately upload your local disk storage to your S3-compatible object store.
SSH into the old Terraform Enterprise instance and navigate to the configured mounted disk path. If you do not know the mounted disk path, you can retrieve it using the replicatedctl
command.
Navigate to the mounted disk path.
Next, set your AWS credentials as environment variables. These credentials must have access to write to S3.
Next, upload the contents of each directory in the <DISK_PATH>/aux/archivist
directory.
NOTE: Some directories may not exist in your installation. Ensure that you upload all contents of the archivist
directory to your object storage and that you prefix each directory with archivist
.
Restart Terraform Enterprise
SSH into the new Terraform Enterprise instance and stop the Terraform Enterprise application.
Watch the status of the Terraform Enterprise application until the State
is stopped
.
Once it has stopped, start Terraform Enterprise application.
Watch the status of the Terraform Enterprise application until the State
is started
.
Once the Terraform Enterprise application is started, you have successfully migrated to external services.