Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Stackland
  • What's new
  • Installation
    • All tutorials
    • Installing Stackland on Yandex BareMetal
    • Setting up external access to a pod in a cluster
    • All guides
        • Creating a cluster PostgreSQL
        • Updating cluster settings
        • Performance diagnostics
        • Creating backups
        • Recovering a cluster
        • Deleting a cluster
    • Projects
    • Resource model
  • Access management
  • Pricing policy
  • Diagnostics and troubleshooting

In this article:

  • restoreClusterSpec property
  • Using the CLI
  • Using the management console
  1. Step-by-step guides
  2. Databases
  3. Managed Service for PostgreSQL
  4. Recovering a cluster

Recovering a cluster

Written by
Yandex Cloud
Updated at April 8, 2026
  • restoreClusterSpec property
  • Using the CLI
  • Using the management console

If you have lost a PostgreSQL cluster in a project, you can restore it from a backup.

restoreClusterSpec propertyrestoreClusterSpec property

When restoring from a backup, you can select a source of the cluster configuration (number of instances, storage size, PostgreSQL version, and so on), which is either the backup itself or the manifest:

  • restoreClusterSpec: true (default): Cluster configuration is restored from the backup. The restored cluster will inherit spec.instances, spec.storage, spec.version, and other settings from the original cluster at the time of backup. This property is optional in the manifest.

  • restoreClusterSpec: false: Cluster configuration is sourced from your manifest. Data is restored from the selected backup, while the number of instances, storage size, PostgreSQL version, and other settings are defined in the manifest. Use this mode if you need to restore data into a cluster with a different configuration, e.g., fewer instances or reduced disk size.

This setting is defined in spec.bootstrap.recovery.restoreClusterSpec.

Using the CLIUsing the CLI

  1. Create a file of the PostgresqlCluster resource, e.g., using the touch postgresqlcluster-from-backup.yaml command.

  2. Open the file and paste the configuration for recovery:

    From a backup (configuration sourced from a backup)
    From a backup with a custom configuration
    To a specific point in time:

    Set the spec.bootstrap.recovery.fromBackup property to the name of the backup to recover your cluster from. List of backups: kubectl get PostgresqlBackups -n <project_name>. The cluster configuration (instances, storage, version, and so on) will be sourced from the backup (default: restoreClusterSpec: true).

    apiVersion: postgresql.stackland.yandex.cloud/v1alpha1
    kind: PostgresqlCluster
    metadata:
      name: cluster-restored
      annotations:
        pgcl.io/description: "PostgreSQL Cluster restored from backup"
    spec:
      bootstrap:
        recovery:
          fromBackup: cluster-backup
      backup:
        storage:
          type: stackland-storage
    

    Specify spec.bootstrap.recovery.fromBackup and spec.bootstrap.recovery.restoreClusterSpec: false. Define the cluster configuration (spec.instances, spec.storage, spec.version, and so on) in the manifest. Data will be restored from the backup, but the cluster will be recreated with the settings you defined in the manifest.

    apiVersion: postgresql.stackland.yandex.cloud/v1alpha1
    kind: PostgresqlCluster
    metadata:
      name: cluster-restored-custom-spec
      annotations:
        pgcl.io/description: "PostgreSQL Cluster restored from backup with custom spec"
    spec:
      instances: 1
      storage:
        size: 2Gi
      version: "17"
      bootstrap:
        recovery:
          fromBackup: cluster-backup
          restoreClusterSpec: false
      backup:
        storage:
          type: stackland-storage
    

    For point-in-time recovery (PITR), specify the backup name (PostgresqlBackup) to use in spec.bootstrap.recovery.fromBackup. List of backups: kubectl get PostgresqlBackups -n <project_name>. Use spec.bootstrap.recovery.recoveryTarget.targetTime to set a restore timestamp in RFC3339 format.

    apiVersion: postgresql.stackland.yandex.cloud/v1alpha1
    kind: PostgresqlCluster
    metadata:
      name: cluster-restored-from-pitr
      annotations:
        pgcl.io/description: "PostgreSQL Cluster restored with PITR"
    spec:
      instances: 1
      storage:
        size: 2Gi
      version: "17"
      postgresConfiguration:
        logLevel: info
      bootstrap:
        recovery:
          fromBackup: cluster-backup
          recoveryTarget:
            targetTime: "2025-02-25T10:00:00Z"
      backup:
        storage:
          type: stackland-storage
    
  3. Apply the manifest: kubectl apply -f postgresqlcluster-from-backup.yaml -n <project_name>. Optionally, you can specify the project name in the metadata.namespace resource property and skip it in the command.

Using the management consoleUsing the management console

  1. If you have not opened a project yet, select one.

  2. In the left-hand menu, select PostgreSQL Clusters.

  3. Go to the Backups tab.

  4. Select a backup and click Recover from backup.

  5. Check the cluster settings and modify them if required:

    • Recovery time: Timestamp to recover your cluster up to.
    • Cluster name: Only use lowercase letters, numbers, and hyphens.
    • Number of instances: Number of cluster replicas.
    • PostgreSQL version: Select from the list of available versions.
    • Computing resources, where Limits is the upper limit and Requests is the lower limit.
    • Storage, where Disk type is the storage class (stackland-nvme, stackland-ssd, stackland-hdd, stackland-other). Learn more about storage classes in Disk subsystem.
    • Database: Section containing authentication credentials.
    • Connection pooler: Handles writes and reads; used for all data-modifying operations and critical transactions.
    • Backups: Settings for copying the database to an S3 bucket.
  6. Click Create.

That is it! Your cluster has been recovered and now appears in the project's cluster list.

Was the article helpful?

Previous
Creating backups
Next
Deleting a cluster
© 2026 Direct Cursus Technology L.L.C.