RESTORE
Restores a specific backup. Requires a target keyspace or a list of target tables within that keyspace, and a backup store name. Custom backup store settings can be specified as can a new keyspace for restored data. Returns a UUID for the restore operation.
Synopsis
RESTORE <targets>
FROM BACKUP <backup_id>
FROM STORE <store_name>
[ WITH settings=<settings> ]
[ INTO <keyspace_name_new> ] ;
| Syntax conventions | Description |
|---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
Set, list, map, or tuple.
Angle brackets ( |
|
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
- targets
-
A full single keyspace or a list of tables within that keyspace. Tables are prefixed with the keyspace and multiple tables are separated by commas, for example,
keyspace_1.my_table_1, keyspace_1.my_table_2. - store_name
-
Name of the backup store. Store names can use alphanumeric characters and underscores only. They are case insensitive.
- keyspace_name_new
-
Name of the new keyspace into which the backup data should be restored. The keyspace must exist.
- settings
-
A key/value list of settings particular to the store class. For example, for an
FSBlobStoreclass:settings = {'path':'/path/to/data', 'retention_time':'1w'}Common settings for all store classes
The following settings can be used with any store class.
Setting Description Type Required transfer_rate_limit_mbsMaximum upload rate per node in MB per second.
int
false
retention_timeTime duration for which a snapshot is retained.
duration
false
retention_numberNumber of snapshots retained.
int
false
The parameters
retention_timeandretention_numbercan be used individually or in combination. Setting either to 0 ignores the respective parameter.The
transfer_rate_limit_mbssetting is not supported for Composite backup stores.Examples
Retain backup younger than one week:
'retention_time':'1w'
Retain a minimum of 3 full backup at any point in time:
'retention_number':3
Any non-full backup with a status of INCOMPLETE or QUORUM that occurs between the full snapshots is retained as well.
Retain a mininum of 3 full backups even if older than one week:
'retention_time':'1w','retention_number':3
If, for example, there happen to be four full backups within the
retention_timewindow, all four are retained. If there are only two backups, however, the last backup older than theretention_timewindow will also be retained. In addition, any non-full backup with a status of INCOMPLETE or QUORUM that occurs between the full backups is retained as well.FSBlobStoreclass settingsThe following settings are applicable only to the
FSBlobStoreclass.Setting Description Type Required pathPath where snapshots are stored. The directory must exist.
text
true
AzureBlobStoreclass settingsThe following settings are applicable only to the
AzureBlobStoreclass.Setting Description Type Required containerAzure container in which snapshots are stored.
text
true
endpointAzure endpoint. May be replaced with the Azure account name.
text
true
sas_tokenThe Azure sas_token.
text
true unless Azure Managed Identity authentication mechanism is in use.
GoogleCloudBlobStoreclass settingsThe following settings are applicable only to the
GoogleCloudBlobStoreclass.Setting Description Type Required bucketGoogle Cloud bucket in which snaphots are stored.
text
true
client_emailEmail address associated with the Google Cloud account.
text
false unless
private_keyis setclient_idClient ID associated with the Google Cloud account.
text
false
private_keyPrivate key associated with the Google Cloud account.
text
false unless
client_emailis setprivate_key_idPrivate key ID of the <private_key> associated with the Google Cloud account.
text
false
project_idProject ID associated with the Google Cloud bucket.
text
false
endpointGoogle Cloud Endpoint. See https://cloud.google.com/endpoints/docs/quickstart-endpoints.
text
false
Authentication details
If no credentials are set in the
GoogleCloudBlobStoresettings, Application Default Credentials (ADC) are used. Credentials are checked in the following order:-
ADC checks the environment variable,
GOOGLE_APPLICATION_CREDENTIALS, and, if set, uses the referenced service account file. -
If
GOOGLE_APPLICATION_CREDENTIALSis not set, ADC uses the default service account provided by the Compute Engine, Kubernetes Engine, App Engine, or Cloud Functions depending on the environment on which the application is running. -
If no credentials are found, an error occurs. See: https://cloud.google.com/docs/authentication/production.
S3BlobStoreclass settingsThe following settings are applicable to only the
S3BlobStoreclass.Setting Description Type Required bucketAWS bucket in which snapshots are stored.
text
true
regionAWS region, an alternative to the <endpoint> setting.
text
true if
endpointis not setaccess_keyAccess key used for authentication.
text
false
secret_keySecret key used for authentication.
text
false
default_socket_timeoutSocket timeout in ms.Default: 50,000
int
false
max_error_retryMaximum retries when an error occurs.Default: 3
int
false
default_throttle_retriesEnables retry throttling.Default: true
int
false
server_side_encryptionEnable server-side encryption (AES256).Default: true
boolean
false
accelerated_mode_enabledEnable AWS transfer acceleration. Only applicable to AWS S3. See https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html.Default: true
boolean
false
storage_classStorage class in which Binary Large Objects (BLOBS) are stored. See https://aws.amazon.com/s3/storage-classes/.
text
false
canned_aclAccess Control List (ACL) for buckets and objects.
text
false
endpointEndpoint for the AWS S3 server, an alternative to the <region> setting.
text
true if
regionis not set.Authentication details
If no details are specified in the
S3BlobStoresettings, theDefaultAWSCredentialsProviderChainis used. TheDefaultAWSCredentialsProviderChainsearches for credentials in the following order:-
The environment variables,
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY. -
The Java system properties,
aws.accessKeyIdandaws.secretKey. -
A credential profile located at
~/.aws/credentials. -
Credentials provided through the Amazon EC2 container service if the
AWS_CONTAINER_CREDENTIALS_RELATIVE_URIenvironment variable is set and the security manager has permission to access that variable. -
Instance profile credentials delivered using the Amazon EC2 metadata service.
CompositeStoreclass settingsThe following setting is applicable to only the
CompositeStoreclass.Setting Description Type Required data-center-nameThe key must be a valid DSE datacenter name.
text
The value must be an existing configured backup store:
-
FSBlobStore -
AzureBlobStore -
GoogleCloudBlobStore -
S3BlobStore
-
-
Examples
Restore a full keyspace backup
Restore a specific backup from a file system store class:
RESTORE keyspace_1
FROM BACKUP backup_configuration_1-c0dfeb5b-323e-4e3d-8ebc-6948050e3e70
FROM STORE fs_store_1;
02d2603a-7e22-11e9-8f9e-2a86e4085a59
Restore tables within a keyspace
Restore specific tables within a keyspace:
RESTORE keyspace_1.data_table_1, keyspace_1.data_table_2
FROM BACKUP backup_configuration_1-c0dfeb5b-323e-4e3d-8ebc-6948050e3e70
FROM STORE fs_store_1;
02d3333a-7e22-11e9-8f9e-2a86e4085a59
Restore a keyspace into a new keyspace
Restore a keyspace to a new keyspace:
RESTORE keyspace_1
FROM BACKUP backup_configuration_1-c0dfeb5b-323e-4e3d-8ebc-6948050e3e70
FROM STORE fs_store_1
INTO KEYSPACE keyspace_2;
12f5533a-7e22-11e9-8f9e-2a86e4085a59
Restore a backup with custom store settings into a new cluster
On a node in a new cluster with the Backup and Restore Service enabled, restore a specific backup from an existing FSBlobStore backup store:
RESTORE keyspace_1
FROM BACKUP backup_configuration_1-c0dfeb5b-323e-4e3d-8ebc-6948050e3e70
USING 'FSBlobStore'
WITH settings={'path': '/my/backup/path'};
12e2603b-7e22-11e9-8f9e-2a86e4085a62
The required settings for each backup store class are:
-
FSBlobStore: <path> -
GoogleCloudBlobStore: <bucket> -
S3BlobStore: <bucket> and <region> or <bucket> and <endpoint>
For instructions on enabling the DSE Backup and Restore Service, see Enabling and configuring the DSE Backup and Restore Service .