Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • ClickHouse® version upgrade
      • Stopping and starting a cluster
      • Managing backups
      • Deleting a cluster
  • Access management
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Creating a backup
  • Restoring clusters from backups
  • Getting a list of backups
  • Getting information about backups
  • Setting the backup start time
  • Setting a retention period for automatic backups
  • Deleting a backup
  1. Step-by-step guides
  2. Clusters
  3. Managing backups

Managing backups in Managed Service for ClickHouse®

Written by
Yandex Cloud
Updated at May 5, 2025
  • Creating a backup
  • Restoring clusters from backups
  • Getting a list of backups
  • Getting information about backups
  • Setting the backup start time
  • Setting a retention period for automatic backups
  • Deleting a backup

You can create backups and restore clusters from existing backups.

Managed Service for ClickHouse® also creates automatic daily backups. You can set the backup start time and retention period.

Creating a backupCreating a backup

Warning

Backups are created based on a random replica host. If there is no cluster host data consistency, restoring clusters from backups does not guarantee complete data recovery. For more information, see Backups.

Management console
CLI
REST API
gRPC API
  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and open the Backups tab.
  3. Click Create backup.

The service will start creating a backup without an additional confirmation.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To create a cluster backup:

  1. View a description of the CLI create ClickHouse® backup command:

    yc managed-clickhouse cluster backup --help
    
  2. Request the creation of a backup specifying the cluster name or ID:

    yc managed-clickhouse cluster backup <cluster_name_or_ID>
    

    You can get the cluster name and ID with the list of clusters in the folder.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.Backup method and send the following request, e.g., via cURL:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:backup'
    

    You can request the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.Backup call and send the following request, e.g., via gRPCurl:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.Backup
    

    You can request the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Warning

While you are creating your backup, the cluster performance might degrade.

Restoring clusters from backupsRestoring clusters from backups

When you restore a cluster from a backup, you create a new cluster with the backup data. If the cloud does not have sufficient resources to create such a cluster, you will not be able to restore your data from a backup. The average backup recovery speed is 10 MBps per database core.

You can restore an individual shard or the whole cluster. You can restore the whole cluster only by using the CLI or API.

Before you begin, assign the iam.serviceAccounts.user role or higher to your Yandex Cloud account. You will need this role if the cluster you want to restore is linked to a service account.

Important

When restoring a backup to a cluster without any ZooKeeper hosts, all the tables in the ReplicatedMergeTree family engine are converted to simple MergeTree tables. Data in the converted tables is saved. For more information, see the ClickHouse® documentation.

Management console
CLI
REST API
gRPC API

To restore an existing cluster from a backup:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and open the Backups tab.
  3. Click for the backup you need and click Restore cluster.
  4. Change the settings of the new cluster if required. You can select a folder for the new cluster from the Folder list.
  5. Click Restore cluster.

To restore a previously deleted cluster from a backup:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. In the left-hand panel, select Backups.
  3. Click for the backup you need and click Restore cluster.
  4. Change the settings of the new cluster if required. You can select a folder for the new cluster from the Folder list.
  5. Click Restore cluster.

Managed Service for ClickHouse® will launch the operation to create a cluster from the backup.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To restore a cluster from a backup:

  1. View a description of the CLI restore ClickHouse® cluster command:

    yc managed-clickhouse cluster restore --help
    
  2. Getting a list of available ClickHouse® cluster backups:

    yc managed-clickhouse backup list
    
    +----------------------+---------------------+----------------------+---------------------+-------------+-------+-----------+
    |            ID        |     CREATED AT      |  SOURCE CLUSTER ID   |     STARTED AT      | SHARD NAMES | SIZE  |   TYPE    |
    +----------------------+---------------------+----------------------+---------------------+-------------+-------+-----------+
    | mdb29m1kk9v2******** | 2023-12-08 00:09:17 | c9qud5etkq19******** | 2023-12-08 00:08:06 | shard1      | 30 KB | AUTOMATED |
    | ...                  |                     |                      |                     |             |       |           |
    +----------------------+---------------------+----------------------+---------------------+-------------+-------+-----------+
    
  3. To restore a cluster, run a command according to the backup type:

    • If the backup was created for all cluster shards at once (backup option currently used), provide a single backup ID in the command:

      yc managed-clickhouse cluster restore \
         --backup-id=<cluster_ID>:<backup_ID> \
         --name=<cluster_name> \
         --environment=<environment> \
         --network-name=<network_name> \
         --host type=<host_type>,`
               `zone-id=<availability_zone>,`
               `subnet-id=<subnet_ID> \
         --clickhouse-disk-size=<storage_size_in_GB> \
         --clickhouse-disk-type=<disk_type> \
         --clickhouse-resource-preset=<host_class>
      

      Where:

      • --backup-id: Cluster and backup IDs.

      • --name: Cluster name.

      • --environment: Environment:

        • PRODUCTION: For stable versions of your apps.
        • PRESTABLE: For testing purposes. The prestable environment is similar to the production environment and likewise covered by the SLA, but it is the first to get new functionalities, improvements, and bug fixes. In the prestable environment, you can test compatibility of new versions with your application.
      • --network-name: Network name.

      • --host: Host parameters:

        • type: Host type: clickhouse or zookeeper.
        • zone-id: Availability zone.
        • subnet-id: Subnet ID. Specify if two or more subnets are created in the selected availability zone.
      • --resource-preset: Host class.

      • --disk-size: Storage size in GB.

      • --disk-type: Disk type:

        • network-hdd
        • network-ssd
        • local-ssd
        • network-ssd-nonreplicated * network-ssd-io-m3
    • If backups were created separately for each cluster shard (legacy backup option), to restore the entire cluster, provide the backup IDs of all cluster shards:

      yc managed-clickhouse cluster restore \
         --backup-id=<list_of_backup_IDs_for_all_shards> \
         ...
      
  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.Restore method and send the following request, e.g., via cURL:

    1. Create a file named body.json and add the following contents to it:

      {
        "backupId": "<cluster_ID>:<backup_ID>",
        "additionalBackupIds": [
          <list_of_additional_IDs_of_backups>
        ],
        "name": "<cluster_name>",
        "environment": "<environment>",
        "configSpec": { <cluster_configuration> },
        "hostSpecs": [
          {
            "type": "<host_type>",
            "zoneId": "<availability_zone>",
            "subnetId": "<subnet_ID>",
            "shardName": "<shard_name>",
            "assignPublicIp": <public_access_to_host>
          },
          { <similar_configuration_for_host_2> },
          { ... },
          { <similar_configuration_for_host_N> }
        ],
        "folderId": "<folder_ID>",
        "networkId": "<network_ID>",
        "serviceAccountId": "<service_account_ID>",
        "securityGroupIds": [
          <list_of_security_group_IDs>
        ],
        "deletionProtection": <cluster_deletion_protection>
      }
      

      Where:

      • backupId: Cluster and backup IDs.

        This will restore your cluster as a whole.

      • additionalBackupIds: Array containing a list of additional IDs of your backups. Use this parameter if backups have been created separately for each shard (legacy backup option).

        The shards for which those backups were created will be restored. To restore the entire cluster, provide backup IDs for all cluster shards.

      • name: Cluster name.

      • environment: Environment:

        • PRODUCTION: For stable versions of your apps.
        • PRESTABLE: For testing purposes. The prestable environment is similar to the production environment and likewise covered by the SLA, but it is the first to get new functionalities, improvements, and bug fixes. In the prestable environment, you can test compatibility of new versions with your application.
      • configSpec: ClickHouse® cluster configuration. For a detailed description of the parameters, see the Cluster.restore method description.

      • hostSpecs: Array with settings for the new hosts. One array element contains settings for a single host and has the following structure:

        • type: Host type.
        • zoneId: Availability zone.
        • subnetId: Subnet ID.
        • shardName: Shard name.
        • assignPublicIp: Internet access to the host via a public IP address, true or false.
      • folderId: ID of the folder to create the cluster in.

      • networkId: ID of the network to create the cluster in.

      • serviceAccountId: Service account ID.

      • securityGroupIds: Array of security group IDs.

      • deletionProtection: Option to manage cluster protection against accidental deletion.

        Even with cluster deletion protection enabled, one can still delete a user or database or connect manually and delete the database contents.

      You can request the cluster ID and backup ID together with the list of backups in the folder.

    2. Run this request:

      curl \
          --request POST \
          --header "Authorization: Bearer $IAM_TOKEN" \
          --header "Content-Type: application/json" \
          --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters:restore' \
          --data "@body.json"
      
  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.Restore call and send the following request, e.g., via gRPCurl:

    1. Create a file named body.json and add the following contents to it:

      {
        "backup_id": "<cluster_ID>:<backup_ID>",
        "additional_backup_ids": [
          <list_of_additional_IDs_of_backups>
        ],
        "name": "<cluster_name>",
        "environment": "<environment>",
        "config_spec": { <cluster_configuration> },
        "host_specs": [
          {
            "type": "<host_type>",
            "zone_id": "<availability_zone>",
            "subnet_id": "<subnet_ID>",
            "shard_name": "<shard_name>",
            "assign_public_ip": <public_access_to_host>
          },
          { <similar_configuration_for_host_2> },
          { ... },
          { <similar_configuration_for_host_N> }
        ],
        "folder_id": "<folder_ID>",
        "network_id": "<network_ID>",
        "service_account_id": "<service_account_ID>",
        "security_group_ids": [
          <list_of_security_group_IDs>
        ],
        "deletion_protection": <cluster_deletion_protection>
      }
      

      Where:

      • backup_id: Cluster and backup IDs.

        This will restore your cluster as a whole.

      • additional_backup_ids: Array containing a list of additional IDs of your backups. Use this parameter if backups have been created separately for each shard (legacy backup option).

        The shards for which those backups were created will be restored. To restore the entire cluster, provide backup IDs for all cluster shards.

      • name: Cluster name.

      • environment: Environment:

        • PRODUCTION: For stable versions of your apps.
        • PRESTABLE: For testing purposes. The prestable environment is similar to the production environment and likewise covered by the SLA, but it is the first to get new functionalities, improvements, and bug fixes. In the prestable environment, you can test compatibility of new versions with your application.
      • config_spec: ClickHouse® cluster configuration. For a detailed description of the parameters, see the ClusterService/Restore call description.

      • host_specs: Array with settings for the new hosts. One array element contains settings for a single host and has the following structure:

        • type: Host type.
        • zone_id: Availability zone.
        • subnet_id: Subnet ID.
        • shard_name: Shard name.
        • assign_public_ip: Internet access to the host via a public IP address, true or false.
      • folder_id: ID of the folder to create the cluster in.

      • network_id: ID of the network to create the cluster in.

      • service_account_id: Service account ID.

      • security_group_ids: Array of security group IDs.

      • deletion_protection: Option to manage cluster protection against accidental deletion.

        Even with cluster deletion protection enabled, one can still delete a user or database or connect manually and delete the database contents.

      You can request the cluster ID and backup ID together with the list of backups in the folder.

    2. Run this request:

      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d @ \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.clickhouse.v1.ClusterService.Restore \
          < body.json
      
  4. View the server response to make sure the request was successful.

Getting a list of backupsGetting a list of backups

Management console
CLI
REST API
gRPC API

To get a list of cluster backups:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and open the Backups tab.

To get a list of all backups in a folder:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. In the left-hand panel, select Backups.

These lists contain the following information:

  • ID of the backup.
  • Source shard.
  • Backup size.
  • Backup type: Automatic (Automated) or manual (Manual).
  • Start time of backup creation in UTC (Coordinated Universal Time).
  • End time of backup creation in UTC.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of ClickHouse® cluster backups available in the default folder, run this command:

yc managed-clickhouse backup list
+----------------------+---------------------+----------------------+---------------------+-------------+-------+-----------+
|            ID        |     CREATED AT      |  SOURCE CLUSTER ID   |     STARTED AT      | SHARD NAMES | SIZE  |   TYPE    |
+----------------------+---------------------+----------------------+---------------------+-------------+-------+-----------+
| mdb29m1kk9v2******** | 2023-12-08 00:09:17 | c9qud5etkq19******** | 2023-12-08 00:08:06 | shard1      | 30 KB | AUTOMATED |
| mdb9sds0ast2******** | 2023-12-07 08:17:04 | c9qud5etkq19******** | 2023-12-07 08:15:54 | shard1      | 30 KB | MANUAL    |
+----------------------+---------------------+----------------------+---------------------+-------------+-------+-----------+

The resulting table contains the following information:

  • ID of the backup.
  • End time of backup creation in UTC (Coordinated Universal Time).
  • ID of the cluster that the backup was created for.
  • Start time of backup creation in UTC.
  • Source shard name.
  • Backup size.
  • Backup type: Automatic (AUTOMATED) or manual (MANUAL).
  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. To get a list of ClickHouse® cluster backups:

    1. Use the Cluster.ListBackups method and send the following request, e.g., via cURL:

      curl \
          --request GET \
          --header "Authorization: Bearer $IAM_TOKEN" \
          --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>/backups'
      

      You can request the cluster ID with the list of clusters in the folder.

    2. View the server response to make sure the request was successful.

  3. To get a list of backups for all the ClickHouse® clusters in a folder:

    1. Use the Backup.List method and send the following request, e.g., via cURL:

      curl \
          --request GET \
          --header "Authorization: Bearer $IAM_TOKEN" \
          --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/backups' \
          --url-query folderId=<folder_ID>
      

      You can request the folder ID with the list of folders in the cloud.

    2. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. To get a list of ClickHouse® cluster backups:

    1. Use the ClusterService.ListBackups call and send the following request, e.g., via gRPCurl:

      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d '{
                  "cluster_id": "<cluster_ID>"
              }' \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.clickhouse.v1.ClusterService.ListBackups
      

      You can request the cluster ID with the list of clusters in the folder.

    2. View the server response to make sure the request was successful.

  4. To get a list of backups for all the ClickHouse® clusters in a folder:

    1. Use the BackupService.List call and send the following request, e.g., via gRPCurl:

      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/backup_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d '{
                  "folder_id": "<folder_ID>"
              }' \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.clickhouse.v1.BackupService.List
      

      You can request the folder ID with the list of folders in the cloud.

    2. View the server response to make sure the request was successful.

Getting information about backupsGetting information about backups

Management console
CLI
REST API
gRPC API

To get information about the backup of an existing cluster:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and open the Backups tab.

To get information about the backup of a previously deleted cluster:

  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. In the left-hand panel, select Backups.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To get information about a ClickHouse® cluster backup, run this command:

yc managed-clickhouse backup get <cluster_ID>:<backup_ID>

You can get the cluster ID and backup ID together with the list of backups.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Backup.Get method and send the following request, e.g., via cURL:

    curl \
        --request GET \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/backups/<cluster_ID>:<backup_ID>'
    

    You can get the cluster ID and backup ID together with the list of backups.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the BackupService.Get call and send the following request, e.g., via gRPCurl:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/backup_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "backup_id": "<cluster_ID>:<backup_ID>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.BackupService.Get
    

    You can get the cluster ID and backup ID together with the list of backups.

  4. View the server response to make sure the request was successful.

Setting the backup start timeSetting the backup start time

Management console
CLI
REST API
gRPC API

In the management console, you can set the backup start time when creating or updating a cluster.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To set the backup start time, provide the required value in HH:MM:SS format in the --backup-window-start argument of the cluster update command:

yc managed-clickhouse cluster update <cluster_name_or_ID> \
   --backup-window-start=<backup_start_time>

You can request the cluster ID and name with the list of clusters in the folder.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.Update method and send the following request, e.g., via cURL:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

    curl \
        --request PATCH \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>' \
        --data '{
                  "updateMask": "configSpec.backupWindowStart",
                  "configSpec": {
                    "backupWindowStart": {
                      "hours": "<hours>",
                      "minutes": "<minutes>",
                      "seconds": "<seconds>",
                      "nanos": "<nanoseconds>"
                    }
                  }
                }'
    

    Where:

    • updateMask: List of parameters to update as a single string, separated by commas.

      Here only one parameter is specified: configSpec.backupWindowStart.

    • configSpec.backupWindowStart: Backup start time (UTC):

      • hours: Hours in 24-hour format
      • minutes: Minutes
      • seconds: Seconds
      • nanos: Nanoseconds

    You can request the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.Update call and send the following request, e.g., via gRPCurl:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the update_mask parameter as an array of paths[] strings.

    Format for listing settings
    "update_mask": {
        "paths": [
            "<setting_1>",
            "<setting_2>",
            ...
            "<setting_N>"
        ]
    }
    
    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>",
              "update_mask": {
                "paths": [
                  "config_spec.backup_window_start"
                ]
              },
              "config_spec": {
                "backup_window_start": {
                  "hours": "<hours>",
                  "minutes": "<minutes>",
                  "seconds": "<seconds>",
                  "nanos": "<nanoseconds>"
                }
              }
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.Update
    

    Where:

    • update_mask: List of parameters to update as an array of paths[] strings.

      Here only one parameter is specified: config_spec.backup_window_start.

    • config_spec.backup_window_start: Backup start time (UTC):

      • hours: Hours in 24-hour format
      • minutes: Minutes
      • seconds: Seconds
      • nanos: Nanoseconds

    You can request the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Setting a retention period for automatic backupsSetting a retention period for automatic backups

Management console
CLI
REST API
gRPC API

In the management console, you can set the retention period for automatic backups when creating or modifying a cluster.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To set the retention period for automatic backups, provide the required value in HH:MM:SS format in the --backup-retain-period-days argument of the cluster update command:

yc managed-clickhouse cluster update <cluster_name_or_ID> \
   --backup-retain-period-days=<automatic_backup_retention_period_in_days>

You can request the cluster ID and name with the list of clusters in the folder.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.Update method and send the following request, e.g., via cURL:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

    curl \
        --request PATCH \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>' \
        --data '{
                  "updateMask": "configSpec.backupRetainPeriodDays",
                  "configSpec": {
                    "backupRetainPeriodDays": <number_of_days>
                  }
                }'
    

    Where:

    • updateMask: List of parameters to update as a single string, separated by commas.

      Here only one parameter is specified: configSpec.backupRetainPeriodDays.

    • configSpec.backupRetainPeriodDays: New automatic backup retention period in days.

    You can request the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.Update call and send the following request, e.g., via gRPCurl:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the update_mask parameter as an array of paths[] strings.

    Format for listing settings
    "update_mask": {
        "paths": [
            "<setting_1>",
            "<setting_2>",
            ...
            "<setting_N>"
        ]
    }
    
    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
                "cluster_id": "<cluster_ID>",
                "update_mask": {
                  "paths": [
                    "config_spec.backup_retain_period_days"
                  ]
                },
                "config_spec": {
                  "backup_retain_period_days": <number_of_days>
                }
              }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.clickhouse.v1.ClusterService.Update
    

    Where:

    • update_mask: List of parameters to update as an array of paths[] strings.

      Here only one parameter is specified: config_spec.backup_retain_period_days.

    • config_spec.backup_retain_period_days: New automatic backup retention period in days.

    You can request the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Deleting a backupDeleting a backup

Warning

You can only delete manual backups.

Management console
CLI
REST API
gRPC API
  1. Navigate to the folder dashboard and select Managed Service for ClickHouse.
  2. Click the cluster name and open the Backups tab.
  3. Click for the backup you need and then click Delete backup.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To delete a cluster backup:

  1. View the description of the CLI command to delete a ClickHouse® cluster backup:

    yc managed-clickhouse backup delete --help
    
  2. Request the deletion of a backup by specifying its ID:

    yc managed-clickhouse backup delete <cluster_ID>:<backup_ID>
    

    You can get the cluster ID and backup ID together with the list of backups.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Backup.Delete method and send the following request, e.g., via cURL:

    curl \
      --request DELETE \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/backups/<cluster_ID>:<backup_ID>'
    

    You can get the cluster ID and backup ID together with the list of backups.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the BackupService.Delete call and send the following request, e.g., via gRPCurl:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/backup_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "backup_id": "<cluster_ID>:<backup_ID>"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.BackupService.Delete
    

    You can get the cluster ID and backup ID together with the list of backups.

  4. View the server response to make sure the request was successful.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Migrating hosts to a different availability zone
Next
Deleting a cluster
© 2025 Direct Cursus Technology L.L.C.