Restore a backup

This page describes how to restore an AlloyDB backup.

When you restore a backup, you configure a new cluster in the same region as the backup. AlloyDB creates the cluster and restores the backup's data to that cluster's data storage. Then, you create a primary instance in that cluster to access the data.

Prerequisites

  • The Cloud project you are using must have been enabled to access AlloyDB.
  • You must have one of these IAM roles in the Cloud project you are using:
    • roles/alloydb.admin (the AlloyDB Admin predefined IAM role)
    • roles/owner (the Owner basic IAM role)
    • roles/editor (the Editor basic IAM role)

    If you don't have any of these roles, contact your Organization Administrator to request access.

Procedure

  1. Restore the backup to a new AlloyDB cluster.
  2. Console

    1. In the Google Cloud console, go to the Backups page.

      Go to Backups

    2. In the list of backups, locate the backup you want to restore and click Restore in its row.
    3. In the Cluster ID field, enter an ID for the cluster that will be created to host the restored data.
    4. In the Network list, select the network you want the newly created cluster to be accessible from.
    5. Click Restore.

    gcloud

    To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.

    Use the clusters restore command to create a cluster and restore the backup's data to it.

    gcloud beta alloydb clusters restore CLUSTER_ID \
        --backup=BACKUP_ID \
        --network=NETWORK \
        --region=REGION_ID \
        --project=PROJECT_ID
    • CLUSTER_ID: The ID of the cluster to create.
    • BACKUP_ID: The ID of the backup to restore into the new cluster.
    • NETWORK: The name of the VPC network you want the newly created cluster to be accessible from.
    • REGION_ID: The ID of the region where the backup is stored.
    • PROJECT_ID: The ID of the project containing the backup.
  3. After AlloyDB finishes creating the cluster, create a primary instance for it.

    When creating the new primary instance, you need to specify its configuration, including its size and flags; AlloyDB does not store instance configuration as part of the backup. Note that the configuration need not exactly match that of the original primary instance.

    When AlloyDB finishes creating the instance, you can use it to access your restored data.

  4. Finish configuring the new cluster by setting up read-pool instances, if necessary.