Manual Backup

This section explains how to manually create a backup of a database.

This procedure can be carried out using the Administration API or ConfD.

Prerequisites

Do not add or remove nodes on the archive volume or on the data volume being backed up while a backup is in progress.

Do not stop the database while a backup is in progress.

Procedure - Administration API

The following examples use curl in a Linux terminal to send REST calls to endpoints in the Administration API. You can also use other interfaces and languages to interact with the API. For more information, see Administration API.

Placeholder values are styled as Bash variables, for example: $EXASOL_IP. Replace the placeholders with your own values.

The option --insecure or -k tells curl to bypass the TLS certificate check. This option allows you to connect to a HTTPS server that does not have a valid certificate. Only use this option if certificate verification is not possible and you trust the server.

  1. To get information about the database, send a GET request to the /api/v1/databases endpoint.

    curl --insecure -X "GET" \
    "https://$EXASOL_IP:4444/api/v1/databases" \
    -H "accept: application/json" \
    -H "Authorization: Basic $AUTH_TOKEN"

    The response includes the database ID, name, and version. Additional details are included depending on the configuration and platform.

  2. Each backup is written to an archive volume. By default, an S3 bucket is created during deployment and configured as a remote archive volume. The name of the remote archive volume is cloud_data_remote_volume.

    To get information about existing archive volumes for the database, send a GET request to the /api/v1/databases/DATABASE_ID/volumes endpoint. For example:

    curl --insecure -X "GET" \
    "https://$EXASOL_IP:4444/api/v1/databases/$DATABASE_ID/volumes" \
      -H "accept: application/json" \
      -H "Authorization: Basic $TOKEN"
  3. To create a backup, send a PUT request to the /api/v1/databases/DATABASE_ID/backups/start endpoint.

    You must specify the backup level (level) and expiration time (expire) parameters in the request.

    • The backup level parameter indicates if this is a full or incremental backup. For more information about backup types, see Backup Essentials.
    • The expiration time parameter determines when the backup is considered invalid and can be automatically cleaned up. Expiration time is given in the format #w #d #h #m.

    For example:

    curl --insecure -X "PUT" \
    "https://$EXASOL_IP:4444/api/v1/databases/$DATABASE_ID/backups/start" \
    -H "accept: application/json" \
    -H "Authorization: Basic $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
    "backupVolumeId": 10002,
    "backupVolumeName": "r0002",
    "level": 0,
    "expire": "1w"
    }'

Abort a backup using the Administration API

To abort a backup that is in progress, send a PUT request to the /api/v1/databases/DATABASE_ID/backups/abort endpoint.

curl --insecure -X "PUT" \
"https://$EXASOL_IP:4444/api/v1/databases/$DATABASE_ID/backups/abort" \
-H "accept: application/json" \
-H "Authorization: Basic $TOKEN"

Procedure - ConfD

The following examples use ConfD through the command-line tool confd_client, which is available on all database nodes. You can also access ConfD through XML-RPC in your own Python programs. For more information, see ConfD.

Placeholder values are indicated with UPPERCASE characters. Replace the placeholders with your own values.

  1. Connect to EXAClusterOS (COS) using c4 connect -t <DEPLOYMENT>[.<NODE>]/cos. For example:

    c4 connect -t 1/cos

    In most cases it does not matter on which node you access ConfD. If you do not specify a node, c4 will connect to the first active node in the deployment. If the cluster is configured with an access node, the first node is the access node (usually n10). The command prompt in COS indicates which node you are connected to:

    [root@n10 ~]#

    For more information about how to use c4 connect, see How to use c4.

  2. To find the name of the database, use the ConfD job db_list. For example:

    confd_client db_list
    - MY_DATABASE
  3. To find the names of available remote archive volumes, use the ConfD job remote_volume_list:

    confd_client remote_volume_list

    To find the volume ID of a remote archive volume, use the ConfD job remote_volume_info. The ID is stored under “vid”.

    confd_client remote_volume_info remote_volume_name: VOLUME_NAME

    By default, an S3 bucket is created during deployment and configured as a remote archive volume with the name cloud_data_remote_volume.

    Remote archive volume IDs typically start at 10001.

    See also Create Remote Archive Volume .

    To find the names of available local archive volumes, use the ConfD job st_volume_list:

    confd_client st_volume_list | grep name

    To find the volume ID of a local archive volume, use the ConfD job st_volume_info. The ID is stored under “id”.

    confd_client st_volume_info vname: VOLUME_NAME

    See also Create Local Archive Volume.

  4. To start a backup, use the ConfD job db_backup_start:

    confd_client db_backup_start db_name: DATABASE_NAME backup_volume_name: VOLUME_NAME level: LEVEL expire: 'EXPIRE_TIME'
    Parameter Description
    db_name The database name.
    backup_volume_name The archive volume name. The backup will be stored in this volume.
    level

    The backup level (0, 1 ... 9). Level 0 means a full backup and levels 1 to 9 are incremental backups.

    For more information about backup types, see Backup Essentials.

    expire The expiration time for the backup using the format "#w #d". For example: "1w 3d".

    For example, to create a level 0 backup of the database MY_DATABASE in volume r0001 with a 1 week expiration time:

    confd_client db_backup_start db_name: MY_DATABASE backup_volume_name: r0001 level: 0 expire: '1w'
  5. To verify that the backup was created, use the ConfD job db_backup_list:

    confd_client db_backup_list db_name: MY_DATABASE

Abort a backup

To abort a backup that is in progress, use the ConfD job db_backup_abort:

confd_client db_backup_abort db_name: MY_DATABASE