Terraform
Migrating from Demo Mode to Mounted Disk Mode
Terraform Enterprise removed the Demo operational mode in v202204-1. We strongly recommend upgrading your instance from Demo mode to Mounted Disk mode.
If you are currently running Demo mode and wish to upgrade to Terraform Enterprise v202204-1, you must migrate your application data from the Demo mode Docker volumes to the Mounted Disk directory.
Determining the Operational Mode
Connect to your Terraform Enterprise instance and run the following command.
replicatedctl app-config export --template '{{ .installation_type.Value }}'
If Terraform Enterprise returns the value poc
, you are running Demo mode and
must migrate your application data to the mounted disk directory.
Data Migration is Required
Terraform Enterprise will fail to start with the following error until you migrate your application data.
Unmet start requirement: Required setting "Mounted Disk Path" is not set.
If you run replicatedctl app status
, you see output similar to the
following:
[
{
"AppID": "f9486004126d40904381e029d76353d0",
"Sequence": 609,
"PatchSequence": 0,
"State": "stopped",
"DesiredState": "started",
"Error": "Unmet start requirement: Required setting \"Mounted Disk Path\" is not set.",
"IsCancellable": false,
"IsTransitioning": false,
"LastModifiedAt": "2022-04-11T21:02:18.613686589Z"
}
]
The Replicated console also shows the error message saying Unmet start requirement: Required setting "Mounted Disk Path" is not set. As a result, you must migrating your application data from Demo Mode to Mounted Disk Mode.
Migrating Application Data From Demo Mode to Mounted Disk Mode
Connect to your Terraform Enterprise instance.
Create the mounted disk directory. You can choose any directory, but Terraform Enterprise expects that the directory is backed by persistent storage that can be mounted to the instance.
mkdir -p /opt/terraform-enterprise
Set the
disk_path
application setting to the mounted disk directory.replicatedctl app-config set disk_path --value '/opt/terraform-enterprise'
Migrate the PostgreSQL data to the mounted disk directory.
Create the
postgres
directory under the mounted disk directory.mkdir -p /opt/terraform-enterprise/postgres
Retrieve the PostgreSQL data path from the Docker volume.
demo_database="$(docker volume inspect postgres --format '{{ .Mountpoint }}')"
Migrate the PostgreSQL data to the mounted disk directory.
cp -r "${demo_database}"/* /opt/terraform-enterprise/postgres
Mark the PostgreSQL data as migrated.
touch /opt/terraform-enterprise/postgres/.poc-to-disk-migrated
Migrate the object storage data to the mounted disk directory.
Create the
aux
directory under the mounted disk directory.mkdir -p /opt/terraform-enterprise/aux
Retrieve the object storage data path from the Docker volume.
demo_object_storage="$(docker volume inspect aux --format '{{ .Mountpoint }}')"
Migrate the object storage data to the mounted disk directory.
cp -r "${demo_object_storage}"/* /opt/terraform-enterprise/aux
Mark the object storage data as migrated.
touch /opt/terraform-enterprise/aux/.poc-to-disk-migrated
Restart Terraform Enterprise to apply the changes and start the application in Mounted Disk mode.
Stop Terraform Enterprise.
replicatedctl app stop
Wait for Terraform Enterprise to stop. Terraform Enterprise is stopped once the
State
showsstopped
.replicatedctl app status
Start Terraform Enterprise.
replicatedctl app start