Restoring backups

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.

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:

  1. 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
  2. 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:

  1. 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
  2. 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:

  1. 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
  2. Restore the keyspace into the new keyspace:

    RESTORE keyspace
        FROM BACKUP config_name-UUID
        FROM STORE store_name
        INTO keyspace_new;

    The new keyspace must exist.

  3. 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:

  1. 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
  2. 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:

  1. 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
  2. Restore the keyspace:

    FORCE RESTORE <keyspace>
        FROM BACKUP <config_name>-<UUID>
        FROM STORE <store_name>;
  3. 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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com