Manual backup
Learn how to manually start a backup of a database.
Prerequisites
- The database must be running.
-
You must have an archive volume for the backups. For more information, see Create local archive volume or Create remote archive volume.
Do not stop the database while a backup is in progress.
Do not modify the archive volume or the data volume while a backup is in progress.
Procedure
This procedure uses 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.
-
Connect to the cluster operating system (COS) using
c4 connect -i PLAY_ID -s cos.Example:
Copy./c4 connect -i c3275f84 -s cosTo find the play ID, you can use
c4 ps.For more information about how to use c4 commands, see How to use c4.
-
To find the database name when you are connected to COS, use the ConfD job db_list.
Example:
Copyconfd_client db_list
- MY_DATABASE -
To find the names of available remote archive volumes, use the ConfD job remote_volume_list:
Copyconfd_client remote_volume_listTo find the volume ID of a remote archive volume, use the ConfD job remote_volume_info. The ID is stored under “vid”.
Copyconfd_client remote_volume_info remote_volume_name: VOLUME_NAMERemote archive volume IDs typically start at 10001.
In AWS native cloud deployments, an S3 bucket is created during deployment and configured as a remote archive volume with the name cloud_data_remote_volume.
See also Create remote archive volume.
To find the names of available local archive volumes, use the ConfD job st_volume_list:
Copyconfd_client st_volume_list | grep nameTo find the volume ID of a local archive volume, use the ConfD job st_volume_info. The ID is stored under “id”.
Copyconfd_client st_volume_info vname: VOLUME_NAMESee also Create local archive volume.
-
To start a backup, use the ConfD job db_backup_start:
Copyconfd_client db_backup_start db_name: DATABASE_NAME backup_volume_name: VOLUME_NAME level: LEVEL expire: 'EXPIRE_TIME'Parameter Description db_nameThe database name. backup_volume_nameThe archive volume name. The backup will be stored in this volume. levelThe 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.
expireThe 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:
Copyconfd_client db_backup_start db_name: MY_DATABASE backup_volume_name: r0001 level: 0 expire: '1w' -
To verify that the backup was created, use the ConfD job db_backup_list:
Copyconfd_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:
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:
confd_client db_backup_abort db_name: MY_DATABASE