[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[[["\u003cp\u003eThis page provides instructions on how to restore an AlloyDB for PostgreSQL cluster from a stored backup, which is useful for reverting to a state older than the recovery window or for restoring a cluster that is offline.\u003c/p\u003e\n"],["\u003cp\u003eRestoring from a backup involves creating a new cluster in the same region as the backup, and the backup can reside in a different project than the source cluster.\u003c/p\u003e\n"],["\u003cp\u003eUsers must have specific IAM roles and permissions to perform a restoration, including \u003ccode\u003eroles/alloydb.admin\u003c/code\u003e or other roles like \u003ccode\u003eroles/owner\u003c/code\u003e and \u003ccode\u003eroles/editor\u003c/code\u003e along with compute and service networking permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe process can be executed through the Google Cloud console or the \u003ccode\u003egcloud\u003c/code\u003e CLI, and optionally allows the use of customer-managed encryption keys (CMEK) for the restored cluster's data.\u003c/p\u003e\n"],["\u003cp\u003eAfter restoring the cluster from a backup, a primary instance must be created to access the data, and if needed, read-pool instances can also be configured for the cluster.\u003c/p\u003e\n"]]],[],null,["# Restore a cluster from a stored backup\n\nThis page describes how to restore an AlloyDB for PostgreSQL cluster from a stored\nbackup. Use this method to restore a cluster to a state older than its recovery\nwindow, or to restore a cluster that is no longer online.\n\n\nBefore you begin\n----------------\n\n- The Google Cloud project you are using must have been [enabled to access AlloyDB](/alloydb/docs/project-enable-access).\n- You must have one of these IAM roles in the Google Cloud project you are using:\n - `roles/alloydb.admin` (the AlloyDB Admin predefined IAM role)\n - `roles/owner` (the Owner basic IAM role)\n - `roles/editor` (the Editor basic IAM role)\n\n If you don't have any of these roles, contact your Organization Administrator to request\n access.\n\n- You must have all of the following IAM permissions in the Google Cloud project you are using:\n - `compute.networks.list`\n - `compute.addresses.create`\n - `compute.addresses.list`\n - `compute.globalAddresses.create`\n - `compute.globalAddresses.list`\n - `servicenetworking.services.addPeering`\n\n \u003cbr /\u003e\n\n To gain these permissions while following the principle of least privilege, ask\n your administrator to grant you the `roles/alloydb.admin` (\n AlloyDB Admin predefined IAM) role.\n\n\u003cbr /\u003e\n\nRestore from a backup\n---------------------\n\nWhen you restore from a backup, you configure a new cluster.\nYou must create this new cluster in the same region as the backup.\nThe destination of a restore can be a different project\nthan the source cluster. AlloyDB creates the cluster and restores\nthe backup's data to that cluster's data storage. Then, you create an instance\nin that cluster to access the data.\n\n### Restore a cross-regional backup\n\nTo restore a backup to a different region, you must create an on-demand backup in the target region.\nThen, you can use your on-demand backup for the restore in the target region.\n\nTo restore a backup to a different region, follow these steps:\n\n1. [Create an on-demand backup](/alloydb/docs/backup/create-on-demand) in the target region.\n2. [Restore the on-demand backup to a new cluster](#restore-new-cluster) in the target region.\n\n### Restore a backup to a new AlloyDB cluster\n\nYou can restore your backup to a new AlloyDB cluster using the Google Cloud console or Google Cloud CLI.\n\n1. Restore the backup to a new AlloyDB cluster. \n\n### Console\n\n1. In the Google Cloud console, go to the **Backups** page.\n\n [Go to Backups](https://console.cloud.google.com/alloydb/backups)\n2. In the list of backups, locate the backup you want to restore and click **Restore** in its row.\n3. In the **Cluster ID** field, enter an ID for the cluster that will be created to host the restored data.\n4. In the **Network** list, select the network you want the newly created cluster to be accessible from.\n5. If you want to encrypt the new cluster's data with a [customer-managed encryption key (CMEK)](/alloydb/docs/cmek)\n instead of Google-managed encryption, follow these\n additional steps:\n\n 1. Click **Advanced encryption options**.\n 2. Select **Cloud KMS key**.\n 3. In **Key type** , select **Cloud KMS**.\n 4. Select a\n customer-managed key from the menu that appears.\n\n The Google Cloud console limits this list to keys\n within the same Google Cloud project and region as the\n new cluster. To use a key that is not on this list, click\n **Don't see your key? Enter key resource\n name**, and then type the key's resource name into\n the resulting dialog.\n\n Note that using CMEK with AlloyDB requires\n some additional setup. For more information, see [Using CMEK with\n AlloyDB](/alloydb/docs/use-cmek).\n6. Click **Restore**.\n\n### gcloud\n\nTo use the gcloud CLI, you can\n[install and initialize](/sdk/docs/install) the Google Cloud CLI, or you\ncan use [Cloud Shell](/shell/docs/using-cloud-shell).\n\nUse the [`\ngcloud alloydb clusters restore`](/sdk/gcloud/reference/alloydb/clusters/restore) command to create a cluster and\nrestore the backup's data to it. \n\n```\ngcloud alloydb clusters restore CLUSTER_ID \\\n --backup=BACKUP_ID \\\n --network=NETWORK \\\n --region=REGION_ID \\\n --project=PROJECT_ID\\\n --async\n```\n\nThis command returns an operation, whose status you can query using the [`gcloud alloydb operations describe`](/sdk/gcloud/reference/alloydb/operations/describe) command. \n\n```\ngcloud alloydb operations describe OPERATION_ID \\\n --region=REGION_ID \\\n --project=PROJECT_ID\n```\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e: The ID of the cluster to create.\n- \u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e: The ID of the backup to restore into the new cluster. \n To restore from a backup in a different project, replace with the full backup path in the following format: \n `projects/`\u003cvar translate=\"no\"\u003eSOURCE_PROJECT\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eSOURCE_REGION\u003c/var\u003e`/backups/`\u003cvar translate=\"no\"\u003eSOURCE_BACKUP\u003c/var\u003e\n- \u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e: The name of the VPC network you want the newly created cluster to be accessible from.\n- \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e: The ID of the region where the source backup is stored and where the new cluster is created.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project where the new cluster is.\n\nIf you want to encrypt the new cluster's data using a [customer-managed encryption key (CMEK)](/alloydb/docs/cmek)\ninstead of the default Google-managed encryption, then you must provide these additional arguments:\n\n- `--kms-key=`\u003cvar translate=\"no\"\u003eKEY_ID\u003c/var\u003e: The ID of the CMEK key to use.\n- `--kms-keyring=`\u003cvar translate=\"no\"\u003eKEYRING_ID\u003c/var\u003e: The ID of the key ring.\n- `--kms-location=`\u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: The ID of that keyring's region. Note that it must match the cluster's region.\n- `--kms-project=`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The keyring's project ID.\n\nTo restore a cluster with Private Service Connect enabled, make sure that you add the `--enable-private-service-connect` flag.\n2. After AlloyDB finishes creating the cluster,\n [create a primary instance](/alloydb/docs/instance-primary-create)\n for it.\n\n When creating the new primary instance, you need to specify its\n configuration, including its size and flags;\n AlloyDB does not store instance configuration as part\n of the backup. Note that the configuration need not exactly match that of\n the original primary instance.\n\n When AlloyDB finishes creating the instance, you can\n use it to access your restored data.\n3. Finish configuring the new cluster by [setting up read-pool\n instances](/alloydb/docs/instance-read-pool-create), if necessary.\n\nWhat's next\n-----------\n\n- [Restore an existing cluster to a recent past state](/alloydb/docs/backup/restore-pitr).\n- [Create a read pool instance](/alloydb/docs/instance-read-pool-create).\n- [Create a secondary cluster and instance](/alloydb/docs/cross-region-replication/work-with-cross-region-replication)."]]