RESTORE SNAPSHOT

    Table of contents

    where data_section:

    Restore one or more tables, partitions, or metadata from an existing snapshot into the cluster. The snapshot must be given as fully qualified reference with repository_name and snapshot_name.

    To restore everything, use the keyword.

    Single tables (or table partitions) can be restored by using TABLE together with a table_ident and a optional partition reference given the partition_column values.

    It is possible to restore all tables using the TABLES keyword. This will restore all tables but will not restore metadata.

    A single metadata group can be restored by using the related data_section keyword.

    Additionally, multiple data_section keywords can be used to restore multiple concrete sections at once.

    To cancel a restore operation simply drop the tables that are being restored.

    Caution

    If you try to restore a table that already exists, CrateDB will return an error. However, if you try to restore metadata or cluster settings that already exist, they will be overwritten.

    repository_name

    The name of the repository of the snapshot to restore as ident.

    snapshot_name

    The name of the snapshot as ident.

    table_ident

    The name (optionally schema-qualified) of an existing table that is to be restored from the snapshot.

    data_section

    If the table is partitioned, the optional PARTITION clause can be used to restore a snapshot from one partition exclusively.

    partition_column

    One of the column names used for table partitioning

    value

    The respective column value.

    All (specified by the PARTITIONED BY clause) must be listed inside the parentheses along with their respective values using the partition_column = value syntax (separated by commas).

    Because each partition corresponds to a unique set of row values, this clause uniquely identifies a single partition to restore.

    Tip

    The SHOW CREATE TABLE statement will show you the complete list of partition columns specified by the clause.

    The following configuration parameters can be used to modify how the snapshot is restored to the cluster:

    ignore_unavailable

    (Default false) Per default the restore command fails if a table is given that does not exist in the snapshot. If set to true those missing tables are ignored.

    (Default: false) By default the request returns once the restore operation started. If set to the request returns after all selected tables from the snapshot are restored or an error occurred. In order to monitor the restore operation the * sys.shards table can be queried.