Manual Backup

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

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 - ConfD

The following examples use 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 the cluster operating system (COS) using c4 connect -i PLAY_ID -s cos. For example:

    Copy
    ./c4 connect -i c3275f84 -s cos

    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:

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

    Copy
    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”.

    Copy
    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:

    Copy
    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”.

    Copy
    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:

    Copy
    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:

    Copy
    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:

    Copy
    confd_client db_backup_list db_name: MY_DATABASE

Monitor the backup process

To monitor the status of the backup process, use the ConfD job db_backup_progress. The progress of the backup process is returned as a percentage where 100 means backup is completed. For example:

Copy
confd_client db_backup_progress db_name: MY_DATABASE
Comment: Backup is active
Files: []
Level: 0
Name: MY_DATABASE/id_1/level_0/node_0/backup_202406131208
Progress: 5
Type: Backup
Volume ID: 10001
...
confd_client db_backup_progress db_name: MY_DATABASE
Comment: Backup has been successfully finished
Files: []
Level: 0
Name: MY_DATABASE/id_1/level_0/node_0/backup_202406131208
Progress: 100
Type: Backup
Volume ID: 10001

Abort the backup process

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

Copy
confd_client db_backup_abort db_name: MY_DATABASE