You can export most of your current CloudConnexa settings using a custom bash script that runs GET API calls.
Note: CyberShield settings are not yet available through the API. Any CyberShield-related information will not appear in the exported data.
This process requires your CloudConnexa API credentials. To learn how to create API credentials, see Creating API Credentials.
Important: This script must be run on a Linux machine or any system that supports Bash, such as macOS or Windows Subsystem for Linux (WSL).
Make sure the following tools are installed on your system before running the script:
curljq
These tools are preinstalled on most Linux distributions and macOS. If not, install them using your system's package manager (for example, sudo apt install jq curl).
Export your CloudConnexa API credentials as environment variables on your system:
export OPENVPN_CLIENT_ID='CLIENT-ID'
export OPENVPN_CLIENT_SECRET='CLIENT-SECRET'Run the following command to download and execute the export script:
curl -fsSL https://raw.githubusercontent.com/OpenVPN/cloudconnexa-api-scripts/refs/heads/main/export-config/export.sh | bashThe script creates a new folder named cloudconnexa_api_data in the directory where it's executed. Inside, you'll find JSON files containing raw snapshots of your CloudConnexa configuration.
These files are useful for:
- Backups and auditing.
- Preparing data for migration or restore tools.
Note: The JSON files are raw API responses. They may need formatting or adjustments before being used in POST or PUT API requests.
The script fetches data from the following CloudConnexa API endpoints:
| Category | Endpoints |
|---|---|
| Access Management | access-groups, access-visibility/enabled |
| Devices | devices, device-postures |
| DNS | dns-records, dns-log/user-dns-resolutions/enabled |
| Networks | networks, networks/routes, networks/ip-services, networks/applications |
| Hosts | hosts, hosts/ip-services, hosts/applications |
| Location | location-contexts |
| Users | users, user-groups |
| Auth Settings | settings/auth/ldap/group-mappings, settings/auth/saml/group-mappings, settings/auth/trusted-devices-allowed, settings/auth/two-factor-auth |
| DNS Settings | settings/dns/custom-servers, settings/dns/default-suffix, settings/dns/proxy-enabled, settings/dns/zones |
| User Settings | settings/user/connect-auth, settings/user/device-allowance, settings/user/device-allowance-force-update, settings/user/device-enforcement, settings/user/profile-distribution, settings/users/connection-timeout |
| WPC Settings | settings/wpc/client-options, settings/wpc/default-region, settings/wpc/domain-routing-subnet, settings/wpc/routes-advanced-configuration-enabled, settings/wpc/snat, settings/wpc/subnet, settings/wpc/topology |
After execution, the script displays a summary report showing:
- Status of each endpoint (
saved,skipped, orerror) - Number of items retrieved per endpoint
- Total counts for saved, skipped, and error endpoints
Example output:
==========================================
EXPORT SUMMARY REPORT
2024-01-15 10:30:00
==========================================
ENDPOINT STATUS ITEMS
---------------------------------------------- -------------------- ----------
access-groups saved 5
devices saved 12
dns-records skipped 0
...
==========================================
Total endpoints processed: 36
- Saved: 25
- Skipped (empty): 12
- Errors: 1
Data saved in: ./cloudconnexa_api_data/
==========================================