Genesys Cloud - Developer Community

 View Only

Use Cx as Code for Backup Configuration 

10-02-2025 16:23

Hi Team. I have 2 questions:

Question 1:

I'd like to know in more detail how I can migrate each and every object created from Genesys Cloud to another organization. And which objects can't be migrated in CX as code (the goal is to migrate the existing production organization A to the newly activated organization B).

2. Question 2:

I am use the Terreform and CX as Code for export de flow in the Organization. My "main.tf" file is:

# Define los proveedores necesarios.
terraform {
required_providers {
genesyscloud = {
source = "mypurecloud/genesyscloud"
version = ">= 1.4" # asegúrate de usar una versión del proveedor que soporte exportación completa
}
}
}

# Configuración del proveedor para la organización de ORIGEN.
provider "genesyscloud" {
oauthclient_id = "XXXXX"
oauthclient_secret = "XXXXX"
aws_region = "us-east-1"
}


resource "genesyscloud_tf_export" "export" {
directory = "./export" # carpeta destino donde se exportarán los archivos
include_state_file = true # si quieres que genere también el estado (.tfstate) junto con los archivos
log_permission_errors = true # para que muestre errores de permisos si los hay
#export_as_hcl = true # mejor en HCL para usarlo directamente en Terraform # por defecto genera JSON; si tu versión lo soporta puedes pedir HCL :contentReference[oaicite:1]{index=1}
export_computed = true
#export_format = "hcl"
ignore_cyclic_deps = true
compress = false
enable_dependency_resolution = true
use_legacy_architect_flow_exporter = false
split_files_by_resource = false

# Nuevo atributo recomendado
include_filter_resources = ["genesyscloud_flow::Menu_Pruebas_Edward"]

# Muy útil: esto asegura que se exporten dependencias del flujo
#include_dependencies = true
}

I have 2 scenary:

1. When active the enable_dependency_resolution = false and use_legacy_architect_flow_exporter = false, the export is inmediaty and the result is export 4 files: genesyscloud.tf.json, terraform.tfstate, terraform.tfstate.1759274123.backup and Menu_Pruebas_Edward-INBOUNDCALL-c3eab20b-4d16-450e-904e-20319cce771a.yaml (to see in ftp folder "20251001_export"). This export have not dependency,

2. When active the enable_dependency_resolution = true and use_legacy_architect_flow_exporter = false, the export or task never ended. I execute the task until 5 hours without result. What should I correct?

I requiere export de flow with all dependencies. For exemple: queue, data action, data table, prompts, schedule, milestone, outcome, etc. Is possible? How should I adjust the filter or the file?

I appreciate your prompts answers, Edward.


#CXasCode

Statistics
0 Favorited
35 Views
1 Files
0 Shares
3 Downloads
Attachment(s)
txt file
main.txt   1 KB   1 version
Uploaded - 10-02-2025

Comments

10-13-2025 14:18

Hi Edward

sdk_debug = true is a provider level argument. This gives me the log book for all the API calls.

provider "genesyscloud" {
oauthclient_id = "xxxx"
oauthclient_secret = "xxxxx"
aws_region = "us-east-1"
sdk_debug = true
}



If you see long running execution with genesyscloud_tf_export, request you to create a ticket providing the logs in the ticket. When doing terraform apply ,ensure TF_LOG=DEBUG is added too. This gives us more detailed logs for troubleshooting. (TF_LOG=DEBUG terraform apply > tf-debug.log)

Thanks
Hemanth

10-03-2025 16:35

Hi Venkata.

When add the sdk = true in main.ft file is present the error:

 terraform apply

│ Error: Unsupported argument

│   on main.tf line 28, in resource "genesyscloud_tf_export" "export":
│   28:   sdk_debug          = true

│ An argument named "sdk_debug" is not expected here.

I get not the option and execute the terraform apply, but enable_dependency_resolution = true without use_legacy_architect_flow_exporter in the main.tf file, when ececute "terraform apply", for default, use_legacy_architect_flow_exporter is set to true as follow and execution it starts without end or lasts for hours:

 terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are
indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # genesyscloud_tf_export.export will be created
  + resource "genesyscloud_tf_export" "export" {
      + compress                           = false
      + directory                          = "./export"
      + enable_dependency_resolution       = true
      + export_as_hcl                      = false
      + export_computed                    = true
      + export_format                      = "hcl"
      + id                                 = (known after apply)
      + ignore_cyclic_deps                 = true
      + include_filter_resources           = [
          + "genesyscloud_flow::Menu_Pruebas_Edward",
        ]
      + include_state_file                 = true
      + log_permission_errors              = true
      + split_files_by_resource            = false
      + use_legacy_architect_flow_exporter = true
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

_____________________________________

For export only flow architect with dependency (data actions, queues, data table, etc) how should I place of options and filter?

Best regards, Edward.

10-03-2025 11:06

Hi @EdwardEnriqueHerrera,

Thanks for your question! Let me clarify a couple of points for you:

  1. Cx as Code Resource Support: You're on the right track with using the export resource for migration. Cx as Code supports most resources, and you can find the full list of supported ones in the resources section of the documentation here: Genesys Cloud Terraform Provider. This should help you confirm exactly what's covered.
  2. Using enable_dependency_resolution: This setting is useful when you want to export specific resource types along with their dependencies. For example, if you're only exporting genesyscloud_flow and its related dependencies, enabling this option ensures those dependencies are included. However, if your goal is to export the entire organization, you don’t need to enable enable_dependency_resolution. Doing so could lead to duplicate or cyclical dependencies, as the export process will traverse the entire dependency tree by default. If you’re still running into issues  (long running too) where certain resources aren’t exporting completely, I’d recommend opening a Care ticket with Genesys. Be sure to include the relevant logs, and the backend team can dig into the root cause for you.

    Please include 
    sdk_debug          = true
    in provider definition.

    and add TF_LOG=DEBUG when doing terraform apply

Hope this clears things up! Let me know if you have any other questions.

Thanks

Related Entries and Links

No Related Resource entered.