FORCE RESTORE
Forces the restoration of a specific backup even if that backup is incomplete. 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.
|
After a |
Synopsis
RESTORE <targets>
FROM BACKUP <backup_id>
FROM STORE <store_name>
[ WITH settings=<settings> ]
[ INTO <keyspace_name_new> ] ;
Syntax legend
| Syntax conventions | Description |
|---|---|
UPPERCASE |
Literal keyword, unless bold.
If bold, it is a variable.
For example, |
Lowercase |
Not literal |
|
Often represents a variable placeholder that you must replace with a user-defined value. However, angle brackets are also required to surround data types in a set, list, map, or tuple. |
|
Optional command arguments. Do not type the square brackets. |
|
A group of options you can choose from. Do not type the parentheses. |
|
Separates alternative elements when you can choose one of several elements. Type any one of the elements. Do not type the vertical bar. |
|
A repeatable syntax element. Can be reused as often as required. |
|
Single quotation marks must surround literal strings in CQL statements, such as Additionally, single quotation marks are used in Search CQL to surround an entire XML schema declaration.
For example: |
|
Curly braces enclose map collections or key value pairs. A colon separates the key and the value. |
Angle brackets enclose data types in a set, list, map, or tuple. Separate the data types with a comma. |
|
|
Marks the end of a CQL statement. |
|
Separate command line options from command arguments with two hyphens. This syntax is useful when arguments might be mistaken for command line options. |
|
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 optional settings can be used with any store class.
-
transfer_rate_limit_mbs(int): Maximum upload rate per node in MB per second. Not supported for theCompositeStoreclass. -
retention_time(duration): Time duration for which a snapshot is retained. Can be used alone or withretention_number. If set to0, this parameter is ignored. For example, to retain snapshots for one week, set'retention_time':'1w'. -
retention_number(int): Minimum number of snapshots retained. Can be used alone or withretention_time. If set to0, this parameter is ignored. For example, to retain a minimum of three snapshots, set'retention_number':3.If both
retention_timeandretention_numberare set, the retention time only applies if there are more thanretention_numbersnapshots.For example, assume you set
'retention_time':'1w', 'retention_number':3, and there are only two backups in the last week. In order to meet theretention_number, both current backups are retained in addition to the most recent backup that is older than one week.Any partial backups with a status of
INCOMPLETEorQUORUMthat occur between full backups are also retained.
-
-
FSBlobStoreclass settings: For theFSBlobStoreclass, you must include thepathsetting. This is a text value that specifies the path where snapshots are stored. The target directory must already exist. -
AzureBlobStoreclass settings: The following settings are applicable to theAzureBlobStoreclass only. All are required.-
container(text): Azure container in which snapshots are stored. -
endpoint(text): Azure endpoint or Azure account name. -
sas_token(text): Azure Shared Access Signature (SAS) token. Not required if using the Azure Managed Identity authentication mechanism.
-
-
GoogleCloudBlobStoreclass settings: The following settings are applicable to theGoogleCloudBlobStoreclass only:-
bucket(text): Required. Google Cloud bucket in which snapshots are stored. -
project_id(text): Optional. Project ID associated with the Google Cloud bucket. -
endpoint(text): Optional. Google Cloud Endpoint. -
client_email(text): Email address associated with the Google Cloud account. Required only ifprivate_keyis set. -
client_id(text): Optional. Client ID associated with the Google Cloud account. -
private_key(text): Private key associated with the Google Cloud account. Required only ifclient_emailis set. -
private_key_id(text): Optional. Private key ID of theprivate_keyassociated with the Google Cloud account.If no credentials are set in the
GoogleCloudBlobStoresettings, then the Application Default Credentials (ADC) are used. To find credentials, ADC checks if the environment variableGOOGLE_APPLICATION_CREDENTIALSis set. If it is set, ADC uses the referenced service account file. If it isn’t 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.
-
-
S3BlobStoreclass settings: The following settings are applicable to only theS3BlobStoreclass.-
bucket(text): Required. AWS bucket in which snapshots are stored. -
region(text): AWS region, an alternative to theendpointsetting. Required ifendpointis not set. -
endpoint(text): Endpoint for the AWS S3 server, an alternative to theregionsetting. Required ifregionis not set. -
default_socket_timeout(int): Optional. Socket timeout in ms. Default: 50,000. -
max_error_retry(int): Optional. Maximum retries when an error occurs. Default: 3. -
default_throttle_retries(Boolean): Optional. Whether to enable retry throttling. Default: true. -
server_side_encryption(Boolean): Optional. Whether to enable server-side encryption (AES256). Default: true. -
accelerated_mode_enabled(Boolean): Optional. Whether to enable AWS transfer acceleration. Only applicable to AWS S3. Default: false. -
storage_class(text): Optional. Storage class in which Binary Large Objects (BLOBS) are stored. -
canned_acl(text): Optional. Access Control List (ACL) for buckets and objects. -
access_key(text): Optional. Access key used for authentication. -
secret_key(text): Optional. Secret key used for authentication.If no authentication details are specified in the
S3BlobStoresettings, theDefaultAWSCredentialsProviderChainis used. TheDefaultAWSCredentialsProviderChainsearches for credentials by first checking the environment variablesAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY. If these aren’t set, it checks the Java system propertiesaws.accessKeyIdandaws.secretKey. If it still doesn’t find credentials, it checks for a credential profile located at~/.aws/credentials. If no profile is found, it checks for credentials provided through the Amazon EC2 container service if theAWS_CONTAINER_CREDENTIALS_RELATIVE_URIenvironment variable is set and the security manager has permission to access that variable. If none of these methods provide credentials, it checks for instance profile credentials delivered using the Amazon EC2 metadata service.
-
-
CompositeStoreclass settings: For theCompositeStoreclass, you must include thedata-center-namesetting. This setting accepts a key-value pair where the key is a valid DSE datacenter name and the value is an existing configured backup store (one ofFSBlobStore,AzureBlobStore,GoogleCloudBlobStore, orS3BlobStore).
-
Examples
Restore a full keyspace backup
Restore a specific backup from a file system store class:
FORCE 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:
FORCE 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:
FORCE 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:
FORCE 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>
|
After a |
For instructions on enabling the DSE Backup and Restore Service, see Enabling and configuring the DSE Backup and Restore Service .