CX as Code: Exporting full org config for DR backup

Hey folks,

Trying to script a disaster recovery backup of our entire Genesys Cloud org using the CX as Code CLI. The genesys cloud export command runs for ages, but when I check the output directory, it’s missing some custom attributes.

Is there a flag to force a full recursive export including data actions? Right now it feels like it’s skipping complex resources. Here’s the basic command I’m running:

genesys cloud export --org-unit-id <id> --output ./backup

Any ideas why it’s partial?

The CLI export is notoriously flaky with custom attributes. It often skips them if the dependency graph isn’t fully resolved. You’ll get better results hitting the REST API directly for those specific resources.

Here’s a quick snippet to grab custom attributes using the PureCloud SDK. It’s more reliable than waiting for the CLI to finish.

const { PlatformClient } = require('genesys-cloud-purecloud-platform-client');

async function exportCustomAttributes() {
 const api = new PlatformClient.AnalyticsApi();
 const response = await api.getAnalyticsEventsCustomattributes({
 body: {
 query: {
 filter: [{ type: "attributeName", operator: "exists" }]
 }
 }
 });
 
 console.log(JSON.stringify(response.body, null, 2));
}

exportCustomAttributes();

You can also use the /api/v2/customattributes endpoint directly with curl if you prefer. Just make sure your OAuth token has customattributes:view scope. The CLI is good for high-level config, but for data integrity, direct API calls are the way to go.