Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 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
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Creating a backup
  • Restoring a cluster from a backup
  • Getting a list of backups
  • Getting backup info
  • 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 November 26, 2025
  • Creating a backup
  • Restoring a cluster from a backup
  • Getting a list of backups
  • Getting backup info
  • 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

The system uses random replica hosts to create backups. If cluster hosts lack 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 name of your cluster 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 installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To create a cluster backup:

  1. See the description of the CLI command for creating a ClickHouse® backup:

    yc managed-clickhouse cluster backup --help
    
  2. Send a request to create a cluster 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 save it as an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.Backup method, e.g., via the following cURL 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/<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 your request was successful.

  1. Get an IAM token for API authentication and save it as an 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 your request was successful.

Warning

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

Restoring a cluster from a backupRestoring a cluster from a backup

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

You can restore either a single shard or the whole cluster.

Before you begin, assign the following roles to your Yandex Cloud account:

  • managed-clickhouse.restorer or higher for the backup folder and the new cluster folder.
  • iam.serviceAccounts.user or higher if restoring a cluster 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 name of your cluster and open the Backups tab.

  3. Click for the backup you need and click Restore cluster.

  4. Update the new cluster settings, if required. You can select a folder for the new cluster from the Folder list.

    To restore a single shard, make sure to leave only that particular shard checked under Shards. Uncheck the rest of the shards.

    To restore the whole cluster, leave all shards checked under Shards.

    You can set up a separate configuration for each shard you restore.

  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. Update the new cluster settings, if required. You can select a folder for the new cluster from the Folder list.

    To restore a single shard, make sure to leave only that particular shard checked under Shards. Uncheck the rest of the shards.

    To restore the whole cluster, leave all shards checked under Shards.

    You can set up a separate configuration for each shard you restore.

  5. Click Restore cluster.

Managed Service for ClickHouse® will initiate the process of creating a new cluster from the backup.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To restore a cluster from a backup:

  1. See the description of the CLI command for restoring a ClickHouse® cluster:

    yc managed-clickhouse cluster restore --help
    
  2. Get 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 the command below considering the backup type:

    • If the backup was originally made for all the cluster shards at once (backup option currently used), provide this backup's 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> \
         --shard name=<shard_name>,`
               `weight=<shard_weight> \
         --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 an SLA, but it is the first to get new features, improvements, and bug fixes. In the prestable environment, you can test the new versions for compatibility with your application.
      • --network-name: Network name.

      • --host: Host settings:

        • type: Host type, clickhouse or zookeeper.
        • zone-id: Availability zone.
        • subnet-id: Subnet ID. Specify it if the selected availability zone has two or more subnets.
      • --shard: Shard parameters:

        • name: Shard name.
        • weight: Shard weight. The minimum value is 0.

        To restore a specific cluster shard, specify the parameters only for the shard to restore. The shard name must match the shard name in the source cluster.

        To restore the whole cluster, you may skip shard parameters.

      • --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 separate backups were created for each cluster shard (legacy backup option), provide the backup IDs of all the cluster shards to restore the whole cluster:

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

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

    1. Create a file named body.json and paste the following code into it:

      {
        "backupId": "<cluster_ID>:<backup_ID>",
        "additionalBackupIds": [
          <list_of_additional_backup_IDs>
        ],
        "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_settings_for_host_2> },
          { ... },
          { <similar_settings_for_host_N> }
        ],
        "shardSpecs: [
          {
            "name": "<shard_name>",
            "configSpec": {
              "clickhouse": {
                "weight": "<shard_weight>"
              }
          }
        ],
        "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 of additional backup IDs. Use this parameter if separate backups have been created 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 an SLA, but it is the first to get new features, improvements, and bug fixes. In the prestable environment, you can test new versions for compatibility with your application.
      • configSpec: ClickHouse® cluster configuration. For a detailed description of the parameters, see the Cluster.restore method description.

      • hostSpecs: Array of the new hosts' settings. 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.
      • shardSpecs: Array of settings of the shards to restore:

        • name: Shard name. The value must match the shard name in the source cluster.
        • configSpec.clickhouse.weight: Shard weight. The minimum value is 0.

        To restore a specific cluster shard, specify the parameters only for the shard to restore.

        To restore the whole cluster, you may skip this parameter.

        You can set up a separate configuration for each shard you restore.

      • folderId: ID of the folder where you want to create your cluster.

      • networkId: ID of the network where you want to deploy your cluster.

      • 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 query:

      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. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and save it as an 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 paste the following code into it:

      {
        "backup_id": "<cluster_ID>:<backup_ID>",
        "additional_backup_ids": [
          <list_of_additional_backup_IDs>
        ],
        "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_settings_for_host_2> },
          { ... },
          { <similar_settings_for_host_N> }
        ],
        "shard_specs: [
          {
            "name": "<shard_name>",
            "config_spec": {
              "clickhouse": {
                "weight": "<shard_weight>"
              }
          }
        ],
        "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 of additional backup IDs. Use this parameter if separate backups have been created 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 an SLA, but it is the first to get new features, improvements, and bug fixes. In the prestable environment, you can test the new versions for compatibility with your application.
      • config_spec: ClickHouse® cluster configuration. For a detailed description of the parameters, see the ClusterService/Restore call description.

      • host_specs: Array of the new hosts' settings. Each array element contains the configuration 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.
      • shard_specs: Array of settings of the shards to restore:

        • name: Shard name. The value must match the shard name in the source cluster.
        • config_spec.clickhouse.weight: Shard weight. The minimum value is 0.

        To restore a specific cluster shard, specify the parameters only for the shard to restore.

        To restore the whole cluster, you may skip this parameter.

        You can set up a separate configuration for each shard you restore.

      • folder_id: ID of the folder where you want to create your cluster.

      • network_id: ID of the network where you want to deploy your cluster.

      • 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 query:

      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 your 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 name of your cluster and open the Backups tab.

To get the list of all backups in the 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:

  • Backup ID.
  • Source shard names.
  • Backup size.
  • Backup type: Automated or Manual.
  • Backup start time (UTC).
  • Backup end time (UTC).

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command 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 table in the command output contains the following information:

  • Backup ID.
  • Backup end time (UTC).
  • ID of the backed up cluster.
  • Backup start time (UTC).
  • Source shard names.
  • Backup size.
  • Backup type: AUTOMATED or MANUAL.
  1. Get an IAM token for API authentication and set it as an environment variable:

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

    1. Call the Cluster.ListBackups method, e.g., via the following cURL request:

      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 your request was successful.

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

    1. Call the Backup.List method, e.g., via the following cURL request:

      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. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and set it as an 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 your request was successful.

  4. To get a list of backups for all 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 get the folder ID with the list of folders in the cloud.

    2. Check the server response to make sure your request was successful.

Getting backup infoGetting backup info

Management console
CLI
REST API
gRPC API

To get information about a backup of an existing cluster:

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

To get information about a 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 installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command 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 along with the list of backups.

  1. Get an IAM token for API authentication and save it as an environment variable:

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

    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 along with the list of backups.

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

  1. Get an IAM token for API authentication and save it as an 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 along with the list of backups.

  4. View the server response to make sure your 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 the cluster.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To set the backup start time, provide the appropriate 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 save it as an environment variable:

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

    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: Comma-separated list of settings you want to update.

      Here, we only specified a single parameter, 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 your request was successful.

  1. Get an IAM token for API authentication and save it as an 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 settings you want to update as an array of strings (paths[]).

      Here, we only specified a single parameter, 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 get the cluster ID with the list of clusters in the folder.

  4. Check the server response to make sure your 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 updating the cluster.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To set a 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 save it as an environment variable:

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

    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: Comma-separated list of settings you want to update.

      Here, we only specified a single parameter, 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 your request was successful.

  1. Get an IAM token for API authentication and save it as an 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 settings you want to update as an array of strings (paths[]).

      Here, we only specified a single parameter, 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. Check the server response to make sure your 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 name of your cluster and open the Backups tab.
  3. Click for the backup in question and select Delete backup.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To delete a cluster backup:

  1. See the description of the CLI command for deleting a ClickHouse® cluster backup:

    yc managed-clickhouse backup delete --help
    
  2. Send a request to delete a backup, specifying the backup ID:

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

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

  1. Get an IAM token for API authentication and set it as an environment variable:

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

    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 along with the list of backups.

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

  1. Get an IAM token for API authentication and set it as an 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 to execute the following request 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 along with the list of backups.

  4. View the server response to make sure your 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.