Restore Terraform Enterprise from Snapshot
Introduction
The Terraform Enterprise administration dashboard provides a feature to create snapshots of system configuration.
Use Case
The snapshots in which created by Terraform Enterprise administration console can be used to restore Terraform Enterprise in newly created host machine. This method of restoration will maintain set of audit history occurred at system level and other settings such as LDAP configuration, and etc.
Pre-requisites
- The settings file,
/etc/replicated.conf
, should not exist on the destination host machine. - There are additional notes and requirements for airgap installations (detailed here) that will not be covered in this article.
Procedure
To restore Terraform Enterprise from a snapshot, perform the following steps.
- For Mounted Disk installations, login to the source Terraform Enterprise administration console at
https://TFE_HOSTNAME:8800
and navigate to theSettings
page. Click on “Mounted Disk Configuration” and take note of the setting for “Path on Host”. Transfer the data from the mounted disk location to the same place on the destination Terraform Enterprise host machine. This step is not required for External Services installations. - Depending on the type of snapshots being used, take one of the following actions.
- Local Snapshot:
- When using “local” snapshots, the snapshots are located locally on file system. Transfer the entire snapshot directory from source Terraform Enterprise host machine into destination host machine.
- In this case, create a script with the contents from our example script, replacing
absolute_path_to_directory_of_snapshots
with the path to the root of snapshots directory located in the destination host machine.
- S3 Snapshots:
- When using “S3” snapshots, the snapshots are located on S3 and so do not need to be moved between machines.
- In this case, create a script with the contents from our example script, replacing
your_bucket_to_store_snapshots
,region_of_the_bucket
,aws_access_key_id
, andaws_secret_access_key
with appropriate values.
- FTP Snapshots:
- When using “FTP” snapshots, the snapshots are located on SFTP server.
- In this case, create a script with the contents from our example script, replacing
path_to_your_ssh_key
,sftp_server_hostname_or_ip
,user_to_sftp_on_the_remote_server
with appropriate values.
- Local Snapshot:
- On the destination host, execute the script you created in the previous steps. When using the example script provided in our documentation, Terraform Enterprise will be installed on the host, then the latest backup will be pulled in and restored, automatically configuring the application settings as they were before.