Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara memulihkan cluster AlloyDB untuk PostgreSQL dari cadangan yang disimpan. Gunakan metode ini untuk memulihkan cluster ke status yang lebih lama dari periode pemulihannya, atau untuk memulihkan cluster yang tidak lagi online.
Anda harus memiliki salah satu peran IAM ini di Google Cloud project yang Anda gunakan:
roles/alloydb.admin (peran IAM bawaan Admin AlloyDB)
roles/owner (peran IAM dasar Pemilik)
roles/editor (peran IAM dasar Editor)
Jika Anda tidak memiliki salah satu peran ini, hubungi Administrator Organisasi Anda untuk meminta
akses.
Anda harus memiliki semua izin IAM berikut dalam project Google Cloud yang Anda gunakan:
compute.networks.list
compute.addresses.create
compute.addresses.list
compute.globalAddresses.create
compute.globalAddresses.list
servicenetworking.services.addPeering
Untuk mendapatkan izin ini sambil mengikuti prinsip hak istimewa terendah, minta administrator Anda untuk memberi Anda peran roles/alloydb.admin (IAM bawaan Admin AlloyDB).
Memulihkan dari cadangan
Saat memulihkan dari cadangan, Anda mengonfigurasi cluster baru.
Anda harus membuat cluster baru ini di region yang sama dengan cadangan.
Tujuan pemulihan dapat berupa project yang berbeda
dengan cluster sumber. AlloyDB membuat cluster dan memulihkan data cadangan ke penyimpanan data cluster tersebut. Kemudian, Anda membuat instance
di cluster tersebut untuk mengakses data.
Memulihkan cadangan lintas region
Untuk memulihkan cadangan ke region lain, Anda harus membuat cadangan on-demand di region target.
Kemudian, Anda dapat menggunakan cadangan sesuai permintaan untuk pemulihan di region target.
Untuk memulihkan cadangan ke region lain, ikuti langkah-langkah berikut:
Dalam daftar cadangan, temukan cadangan yang ingin Anda pulihkan, lalu klik
Pulihkan di barisnya.
Di kolom Cluster ID, masukkan ID untuk cluster yang akan
dibuat untuk menghosting data yang dipulihkan.
Di daftar Network, pilih jaringan tempat cluster yang baru dibuat
dapat diakses.
Jika Anda ingin mengenkripsi data cluster baru dengan kunci enkripsi yang dikelola pelanggan (CMEK)
alih-alih enkripsi yang dikelola Google, ikuti langkah-langkah
tambahan berikut:
Klik Opsi enkripsi lanjutan.
Pilih Kunci Cloud KMS.
Di Jenis kunci, pilih Cloud KMS.
Pilih kunci yang dikelola pelanggan dari menu yang muncul.
Konsol Google Cloud membatasi daftar ini ke kunci
dalam project dan region Google Cloud yang sama dengan
cluster baru. Untuk menggunakan kunci yang tidak ada dalam daftar ini, klik
Tidak melihat kunci Anda? Masukkan nama resource
kunci, lalu ketik nama resource kunci ke dalam
dialog yang dihasilkan.
Perhatikan bahwa penggunaan CMEK dengan AlloyDB memerlukan
beberapa penyiapan tambahan. Untuk mengetahui informasi selengkapnya, lihat Menggunakan CMEK dengan
AlloyDB.
BACKUP_ID: ID cadangan yang akan dipulihkan ke cluster
baru.
Untuk memulihkan dari cadangan dalam project lain, ganti dengan jalur cadangan
lengkap dalam format berikut: projects/SOURCE_PROJECT/locations/SOURCE_REGION/backups/SOURCE_BACKUP
NETWORK: Nama jaringan VPC yang Anda inginkan agar cluster yang baru dibuat dapat diakses dari jaringan tersebut.
REGION_ID: ID region tempat cadangan
sumber disimpan dan tempat cluster baru dibuat.
PROJECT_ID: ID project tempat cluster baru berada.
Jika Anda ingin mengenkripsi data cluster baru menggunakan kunci enkripsi yang dikelola pelanggan (CMEK), bukan enkripsi yang dikelola Google secara default, Anda harus memberikan argumen tambahan berikut:
--kms-key=KEY_ID: ID kunci CMEK yang akan digunakan.
--kms-keyring=KEYRING_ID: ID key ring.
--kms-location=LOCATION_ID: ID region keyring tersebut. Perhatikan bahwa region ini harus cocok dengan region cluster.
--kms-project=PROJECT_ID: Project ID keyring.
Untuk memulihkan cluster dengan Private Service Connect yang diaktifkan, pastikan Anda menambahkan tanda --enable-private-service-connect.
Setelah AlloyDB selesai membuat cluster, buat instance utama untuk cluster tersebut.
Saat membuat instance utama baru, Anda harus menentukan
konfigurasinya, termasuk ukuran dan flag-nya;
AlloyDB tidak menyimpan konfigurasi instance sebagai bagian
dari cadangan. Perhatikan bahwa konfigurasi tidak harus sama persis dengan konfigurasi
instance utama asli.
Setelah AlloyDB selesai membuat instance, Anda dapat
menggunakannya untuk mengakses data yang dipulihkan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 UTC."],[[["\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)."]]