Creating and managing backup configurations
Create and manage backup configurations for DSE Backup and Restore backup stores.
- A configuration name.
- The name of the keyspace you want to back up.Important: You can only assign one keyspace to a backup configuration. You cannot backup individual tables within a keyspace.
- The name of the backup store or stores in which to store the keyspace backup.
- The frequency at which the backup should be run.
- Whether the backup should run automatically using the specified frequency.Note: If the backup is disabled, the frequency is ignored.
Create an automatic backup configuration
An automatic backup configuration will backup the specified keyspace to the specified backup store at the time specified by the frequency parameter, which is a standard cron expression.
To create an automatic backup configuration:
- Open cqlsh and list the existing backup
stores:
LIST BACKUP STORES; name | class | settings --------------+------------------------------------------------------+-------------------------- store_name | com.datastax.bdp.db.backups.destinations.FSBlobStore | {'path': '/full_path'}
- Create the new backup configuration:
- config_name with a name of your choice. Configuration names can use alphanumeric characters and underscores only. They are case insensitive.
- keyspace with the keyspace to backup.
- backup_store with the name of the backup store to use.Tip: You can specify multiple stores for the backup by separating them with commas. Backups are then stored in each backup store, for instance one in a
FSBlobStore
and one in aS3BlobStore
. - cron_expression with a standard cron expression, for example, daily at
midnight:
0 0 * * *
Tip: Easily generate cron timing expressions using https://crontab-generator.org/. Note that shortcuts such as*/30 * * * *
to run a backup every 30 minutes are not supported. enabled
set totrue
.
CREATE BACKUP CONFIGURATION config_name OF keyspace TO STORE backup_store WITH frequency = 'cron_expression' AND enabled = true;
Note: For more information, see CREATE BACKUP CONFIGURATION. - Verify that the backup configuration was
created:
LIST BACKUP CONFIGURATIONS; name | target_keyspace | stores | frequency | enabled | next_execution_time ---------------+-----------------+---------------------+-------------------+---------+--------------------- config_name | keyspace| ['backup_store'] | cron_expression | True | timestamp
Create a manual backup configuration
The only difference between an automatic backup configuraton and a manual backup configuration
is that enabled
is set to false. The frequency parameter is
ignored and the backup configuration can only be run manually.
To create a manual backup configuration:
- Open cqlsh and list the existing backup
stores:
LIST BACKUP STORES; name | class | settings --------------+------------------------------------------------------+-------------------------- store_name | com.datastax.bdp.db.backups.destinations.FSBlobStore | {'path': '/full_path'}
- Create the new backup configuration:
- config_name with a name of your choice. Configuration names can use alphanumeric characters and underscores only. They are case insensitive.
- keyspace with the keyspace backup.
- backup_store with the name(s) of the backup store to use. Tip: You can specify multiple stores for the backup by separating them with commas. Backups are then stored in each backup store, for instance one in a FSBlobStore and one in a S3BlobStore.
- cron_expression with five asterisks:
* * * * *
because it is ignored. enabled
set tofalse
.
CREATE BACKUP CONFIGURATION config_name OF keyspace TO STORE backup_store [, backup_store_N] WITH frequency = '* * * * *' AND enabled = false;
Note: For more information, see CREATE BACKUP CONFIGURATION. - Verify that the backup configuration was
created:
LIST BACKUP CONFIGURATIONS; name | target_keyspace | stores | frequency | enabled | next_execution_time -------------+-----------------+------------------+-----------+----------+--------------------- config_name | keyspace | ['backup_store'] | * * * * * | False | null
Alter and drop backup configurations
You can alter existing backup configurations and drop backup configurations you no longer need.
To alter an existing backup configuration:
- List your existing backup
configurations:
LIST BACKUP CONFIGURATIONS; name | target_keyspace | stores | frequency | enabled | next_execution_time -------------+-----------------+------------------+-----------+----------+--------------------- config_name | keyspace | ['backup_store'] | * * * * * | False | null
- Alter the backup configuration settings as required:
- Add an additional backup store to the backup
configuration:
ALTER BACKUP CONFIGURATION config_name ADD STORE store_name;
- Remove a backup store from the backup
configuration:
ALTER BACKUP CONFIGURATION config_name DROP STORE store_name;
- Modify the frequency of the backup
configuration:
ALTER BACKUP CONFIGURATION config_name WITH frequency;
- Add an additional backup store to the backup
configuration:
To drop an existing backup configuration:
- List your existing backup
configurations:
LIST BACKUP CONFIGURATIONS; name | target_keyspace | stores | frequency | enabled | next_execution_time -------------+-----------------+------------------+-----------+----------+--------------------- config_name | keyspace | ['backup_store'] | * * * * * | False | null
- Drop an existing backup
configuration:
DROP BACKUP CONFIGURATION config_name;
What to do next
With the backup store and the backup configuration created, continue to Managing backups.