Backup and restore using API calls

Backup

This process uses various API calls to take a DCT appliance backup. The examples uses the curl API client, but any HTTP client can be used.

  1. Establish a new API session and store the session information in a cookie (this example uses ~/cookies.txt):

    Copy
    curl -X POST https://<dct-appliance-hostname>/resources/json/delphix/session -c ~/cookies.txt -H "Content-Type: application/json" -d \
                        '{"type": "APISession", "version": {"type": "APIVersion","major": 1,"minor": 4, "micro": 3}}'

    Expected output:

    Copy
    {"type":"OKResult","status":"OK","result":{"type":"APISession","version":
                        {"type":"APIVersion","major":1,"minor":4,"micro":3},"locale":null,"client":null},"job":null,"action":null}
  2. To login, make a new API call using the same cookies file as the one to establish the session. Substitute the dct-appliance-hostname, and the username and password of a system user.

    Copy
    curl -X POST https://<dct-appliance-hostname>/resources/json/delphix/login \
                            -b ~/cookies.txt \
                            -c ~/cookies.txt \
                            -H "Content-Type: application/json" \
                        -d '{"type": "LoginRequest","username": "<sysadmin-user-name>","password": "<sysadmin-password>","target": "SYSTEM"}'

    Expected output:

    Copy
    {"type":"OKResult","status":"OK","result":"USER-1","job":null,"action":null}
  3. Make an API call to the downloadAppBackup API endpoint and direct the response to a file on disk, at the desired location.

    Copy
    curl https://<dct-appliance-hostname>/resources/json/delphix/system/downloadAppBackup \
                            --fail \
                            -b ~/cookies.txt \
                        -o /path/to/backup.zip
  4. Verify the API call has completed successfully. Since the output is redirected to a file, the above example is using the --fail option of curl, which causes the command to exit with a non-zero exit code if the HTTP response code indicates a failure.

    Copy
    [[ $? -eq 0 ]] && echo "backup success" || echo "backup failed"
                        backup success

    Since version 7.76.0, curl has a --fail-with-body option which can be used instead of --fail and will print error messages directly to the console.

Restore

Follow the instructions provided in the previous section to establish a session and login, then call the uploadRestoreAppBackup API endpoint:

Copy
curl https://<dct-appliance-hostname>/resources/json/delphix/system/uploadRestoreAppBackup \
                -b ~/cookies.txt \
            -F data=@/path/to/backup.zip

Expected output:

Copy
{"type":"OKResult","status":"OK","result":"","job":null,"action":"ACTION-24"}

Troubleshooting

  • If the backup or restore processes fails with a 403 response code, for instance with the following error message: The requested URL returned error: 403

    Either the DCT appliance does not support backup/restore (introduced in DCT version 2025.2.0.0) or the appliance has not been fully setup. Make sure the DCT version is 2025.2.0.0 or newer and if necessary, use the initial setup wizard to configure the DCT appliance.

  • If you are seeing an error such as: curl: (60) SSL certificate problem: self signed certificate in certificate chain

    Then curl is unable to validate the SSL certificate chain configured on your DCT appliance. By default, the DCT appliance uses an insecure self-signed certificate, which would rightfully cause curl to display the above error. If you are unable to replace the self-signed certificate, and you understand the risk, you may use the -k flag to disable certificate verification (this applies both to the provided script and the curl command).