Use Cases
- The load balancer in-front of the Terraform Enterprise server enforces a maximum client body size resulting in a HTTP 413 Request Entity Too Large error when attempting to restore the backup.
- DNS resolution is not possible during the backup/restore.
Procedure
- Perform backup from a client with access to the source Terraform Enterprise server's private IP or directly from the server.
# Find and store the backup token from your source Terraform Enterprise server
Note: The Terraform Enterprise hostname value above is an example, please replace with appropriate value.
export BACKUP_TOKEN=$(replicatedctl app-config export --template '{{.backup_token.Value}}')
# Create a payload.json file with a password to encrypt your backup.blob
cat > payload.json << EOF
{
"password": "befit-brakeman-footstep-unclasp"
}
EOF
# Retrieve the private IP from Replicated's configuration in your source TFE server
replicatedctl params export --template '{{.LocalAddress}}'
# Perform the backup using the Terraform Enterprise server's private IP
curl -k --resolve tfe_source.example.net:443:192.168.78.179 \
--header "Authorization: Bearer $BACKUP_TOKEN" \
--request POST \
--data @payload.json \
--output backup.blob \
https://tfe_source.example.net/_backup/api/v1/backup
-
Copy the
backup.blob
andpayload.json
files to a client with access to the destination Terraform Enterprise server's private IP or directly to the server. - Restore the Terraform Enterprise backup.
# Find and store the backup token for your destination Terraform Enterprise server
export RESTORE_TOKEN=$(replicatedctl app-config export --template '{{.backup_token.Value}}')
# Retrieve the private IP from Replicated's configuration in your destination TFE server
replicatedctl params export --template '{{.LocalAddress}}'
# Perform the restore using the Terraform Enterprise server's private IP
curl -k --resolve tfe_destination.example.net:443:10.0.103.149 \
--header "Authorization: Bearer $RESTORE_TOKEN" \
--request POST \
--form config=@payload.json \
--form snapshot=@backup.blob \
https://tfe_destination.example.net/_backup/api/v1/restore
snapshot applied successfully
# Restart the Terraform Enterprise application after the restore process has completed successfully
replicatedctl app apply-config