Restoring backups
Restore keyspaces and tables using the DSE Backup and Restore Service.
The DSE Backup and Restore service lets you restore full keyspaces as well as individual tables
within a backed up keyspace. In addition, you can also override backup store settings,
allowing you to restore a backup into a cloned cluster without creating a backup store
configuration, and you can force the restoration of incomplete backups in an emergency. For
details, see FORCE RESTORE and RESTORE.
Note: When restoring data from a remote backup store, you may encounter client timeouts
if the restore operation is long running. The client time out does not affect the
restoration process. To increase the client timeout for cqlsh, see cqlsh (startup options). To increase the timeout for
client applications, see the respective driver documentation, DataStax drivers.
Restore a full keyspace backup
To restore a full keyspace from a backup:
- List the backups for the target
keyspace:
LIST BACKUPS FROM KEYSPACE keyspace; id | backup_time | store | keyspace | tables | nodes | schema_versions | status | details -------------------+-------------+------------+------------+----------------------+-----------+-----------------+--------+------------------ config_name-UUID | timestamp | store_name | keyspace | {'table1', 'table2'} | {node_id} | schema_status | status | status_details
- Restore the
keyspace:
RESTORE keyspace FROM BACKUP config_name-UUID FROM STORE store_name;
Restore individual tables from a keyspace
To restore individual tables from within a keyspace backup:
- List the backups for the target
keyspace:
LIST BACKUPS FROM KEYSPACE keyspace; id | backup_time | store | keyspace | tables | nodes | schema_versions | status | details -------------------+-------------+------------+----------+----------------------+-----------+-----------------+----------+------------------ config_name-UUID | timestamp | store_name | keyspace | {'table1', 'table2'} | {node_id} | schema_status | status | status_details
- Restore the tables. Multiple tables can be separated with
commas:
RESTORE table1, table2 FROM BACKUP config_name-UUID FROM STORE store_name;
Restore a keyspace to a new keyspace
To restore keyspace data to a new keyspace:
- List the backups for the target
keyspace:
LIST BACKUPS FROM KEYSPACE keyspace; id | backup_time | store | keyspace | tables | nodes | schema_versions | status | details -------------------+-------------+------------+------------+----------------------+-----------+-----------------+----------+------------------ config_name-UUID | timestamp | store_name | keyspace | {'table1', 'table2'} | {node_id} | schema_status | status | status_details
- Restore the keyspace into the new
keyspace:
RESTORE keyspace FROM BACKUP config_name-UUID FROM STORE store_name INTO keyspace_new;
Important: The new keyspace must exist. - Restore a table to the new
keyspace:
RESTORE keyspace.table_name FROM BACKUP config_name-UUID FROM STORE store_name INTO keyspace_new.table_name;
Restore a keyspace into a cloned cluster
To restore keyspace data to a new keyspace:
- List the backups for the target
keyspace:
LIST BACKUPS FROM KEYSPACE keyspace; id | backup_time | store | keyspace | tables | nodes | schema_versions | status | details -------------------+-------------+------------+----------+----------------------+-----------+-----------------+----------+------------------ config_name-UUID | timestamp | store_name | keyspace | {'table1', 'table2'} | {node_id} | schema_status | status | status_details
- On a node in the new cluster that has the DSE Backup and Restore Service enabled, restore
the
keyspace:
RESTORE keyspace FROM BACKUP config_name-UUID USING 'blob_store_class' WITH settings=settings;
The required settings for each backup store class are:- FSBlobStore: path
- GoogleCloudBlobStore: bucket
- S3BlobStore: bucket and region or bucket and endpoint
Force the restoration of a partial keyspace backup
To restore partial restoration from a backup:
- List the backups for the target
keyspace:
LIST BACKUPS FROM KEYSPACE keyspace; id | backup_time | store | keyspace | tables | nodes | schema_versions | status | details -------------------+-------------+------------+------------+----------------------+-----------+-----------------+--------+------------------ config_name-UUID | timestamp | store_name | keyspace | {'table1', 'table2'} | {node_id} | schema_status | status | status_details
- Restore the
keyspace:
FORCE RESTORE keyspace FROM BACKUP config_name-UUID FROM STORE store_name;
- Run a
nodetool repair
or schedule a manual nodesync on the node. See:
For instructions on enabling the DSE Backup and Restore Service, see Enabling and configuring the DSE Backup and Restore Service .
Cancel a restore in progess
To cancel a restore in progress, start cqlsh and cancel the restore using the restore UUID:
CANCEL RESTORE restore-UUID;
Clean up stale backups
Although a scheduled task runs every two hours to drop backups that are outside of backup store's configured retention policy for a backup store (see Customize backup retention policy), you can manually run a backup cleaning if you wish. For information on manually cleaning backups, see CLEAN BACKUPS.