Manage ClickHouse® backups

Warning

At the moment, you can create backups only for specific ClickHouse® shards. The functionality that allows creating a single backup for all shards within a cluster is currently under development.

Manually create a backup

  1. Go to the Clusters overview page in the console.

  2. Select the cluster you want to create a backup for and click it.

  3. Go to the Backups tab.

  4. Click Create backup.

  5. Name your backup and click Submit. ClickHouse® service automatically creates a separate backup for each shard in the cluster.

Use the BackuprService create method and pass the following parameters:

  • clusterId - the ID of your cluster. To find the cluster ID, get a list of clusters in the project.

  • name - the name of the backup. Must be unique within the project.

Note

Managed Service for ClickHouse® creates backups automatically every day at approximately 1 a.m., according to your timezone.

Restore shards from backups

  1. Go to the Clusters overview page in the console.

  2. Select the cluster whose shards you want to restore and click on it.

  3. Go to the Backups tab.

  4. Select a shard you want to restore a backup from.

  5. Click and select Restore backup. The cluster creation page will open automatically.

  6. Follow the steps from the Create a cluster page to add a new cluster for your backup copy.

    Warning

    Currently, you can't use an existing cluster to store your data after you restore this data from a backup. Create a new cluster for this purpose and redefine its Service, Provider, Region and Resources settings.

To restore a ClickHouse® cluster from a backup, use the ClusterService restore method with the following parameters:

  • project_id - the ID of your project. You can get this value on your project's information page.

  • backup_id - the ID of the backup from which you want to restore the cluster. To get this id, use the BackupService list method with project_id parameter.

  • region_id - for the list of available regions and their region codes, see Areas and regions for Managed Service for ClickHouse®.

  • name - your cluster's name. It must be unique within the project.

  • resources - specify the following from the doublecloud.clickhouse.v1.ClusterResources model:

    • resource_preset_id - specify the name of the hardware resource preset for your cluster. For the list of available presets for ClickHouse® clusters, see DoubleCloud hardware instances.

    • disk_size - the storage size for your cluster in bytes. We recommend allocating no less than 34359738368 bytes (32 GB).

    • replica_count - specify the number of replicas between 1 and 3.

    • shard_count - specify the number of shards.

Delete a backup

Warning

At the moment, you can't delete a backup manually from the console. The DoubleCloud service automatically deletes backups after 7 days since creation.

For manual deletion, use the API.

  1. Go to the Clusters overview page in the console.

  2. Select the cluster whose backup you want to delete and click it.

  3. Go to the Backups tab.

  4. Select a backup you want to delete.

  5. Click and select Delete.

  6. Click Delete to confirm your action.

Use the BackupService delete method and pass the backup ID in the backup_id request parameter.

To find the backup ID, use the BackupService list method with project_id parameter. You can get this value on your project's information page.

See also