Restore backups

This page shows you how to restore a backup to an instance.

Required roles

To get the permissions that you need to restore a backup, ask your administrator to grant you the following IAM roles on your project:

  • Provides ability to use Cloud Key Management Service resources for encrypt and decrypt operations only: Cloud Key Management Service CryptoKey Encrypter/Decrypter ( roles/cloudkms.cryptoKeyEncrypterDecrypter )

For more information about granting roles, see Manage access to projects, folders, and organizations .

You might also be able to get the required permissions through custom roles or other predefined roles .

Restore to the source or an existing instance

You can restore a basic tier backup to the source instance or to a file share of an existing Filestore instance.

Before initiating a restore operation, we recommend pausing applications and unmounting from the file system to reduce the risk of application errors. You must then remount the file share after it is restored from a backup. All outstanding file locks are revoked upon successful restoration. During restoration, client READ and WRITE operations are paused.

When restoring a backup to an existing Filestore instance, the capacity of the target instance must be greater than or equal to that of the original instance the backup was created from. If the original instance has a greater capacity, you must first increase the target instance's capacity before attempting the restore operation.

If a backup restore to a Basic HDD or Basic SSD instance fails, the file share state remains unchanged.

Console

  1. In the Google Cloud console, go to the Instancespage.

Go to Instances

  1. In the instance list, click the instance you want to restore the backup from to see the instance details.
  2. Click the Backupstab.
  3. Locate the backup you want to restore from and click More actions.
  4. Click Restore backup.
  5. Choose a target instance to restore:
    • If restoring the source instance, click Source instance.
    • If restoring to another existing instance:
      1. Click Other existing instance.
      2. Click Select instance.
      3. Select the target instance where you want the restored backup to reside and click Select.
  6. Click Restore.
  7. Click the acknowledgement checkbox.
  8. Enter the name of the backup in the input field and click Restore.

gcloud

To restore a Filestore file share to an existing instance, run the instances restore command:

 gcloud filestore instances restore INSTANCE_ID 
\
  --source-backup= BACKUP_ID 
\
  --source-backup-region= BACKUP_LOCATION 
\
  --file-share= FILE_SHARE_NAME 
\
  --zone= INSTANCE_LOCATION 
 

Where:

  • INSTANCE_ID is the name of the existing Filestore instance to restore the file share to.
  • BACKUP_ID is the name of the backup to restore from.
  • BACKUP_LOCATION is the region where the backup is located.
  • FILE_SHARE_NAME is the name of the file share to restore to.
  • INSTANCE_LOCATION is the zone that the Filestore instance is located.

Example

The following command restores mybackup , which is located in region asia-east2 , to file share vol1 on Filestore instance myinstance , which is located in zone us-central1-c :

 gcloud filestore instances restore myinstance \
  --source-backup=mybackup \
  --source-backup-region=asia-east2  \
  --file-share=vol1 \
  --zone=us-central1-c 

Restore to a new instance

When a Zonal, Regional, and Enterprise backup is restored to a new Filestore instance, the capacity of the new file share must be greater than or equal to the capacity of the backup.

Console

  1. In the Google Cloud console, go to the Instancespage.

    Go to Instances

  2. Click Backups.

  3. Click the name of the backup you want to restore from.

  4. Click Restore.

  5. Click New instance.

  6. Configure the new instance by following the instructions on the page. For details, see Create an instance .

  7. Click Restore.

gcloud

To restore a Filestore file share to a new instance, run the instances create command:

 gcloud filestore instances create INSTANCE_NAME 
\
  --zone= ZONE 
\
  --tier= TIER 
\
  --file-share=name= FILE_SHARE_NAME 
,capacity= FILE_SHARE_CAPACITY 
,source-backup= SOURCE_BACKUP_NAME 
,source-backup-region= SOURCE_BACKUP_LOCATION 
\
  --network=name= VPC_NETWORK 
,reserved-ip-range= RESERVED_IP_ADDRESS 
 

Where:

  • INSTANCE_NAME is the name you want to give to the new Filestore instance.
  • ZONE is the zone where the Filestore instance resides.
  • TIER is the service tier you want to use. This should be the same as the source backup.
  • FILE_SHARE_NAME is the name you specify for the NFS file share that is served from the instance.
  • FILE_SHARE_CAPACITY is the capacity you want for the file share.
  • SOURCE_BACKUP_NAME is the name of the backup to restore from.
  • SOURCE_BACKUP_LOCATION is the region where the backup is located.
  • VPC_NETWORK is the name of the VPC network you want the instance to use.
  • RESERVED_IP_ADDRESS is the IP address range for the Filestore instance.

For gcloud flag details, see Create an instance .

Example

The following command creates a new Filestore instance myinstance-restored located in zone us-central1-c on network default. Backup mybackup located in region asia-east2 is restored on file share vol1 of myinstance-restored with a 2TiB capacity:

 gcloud filestore instances create myinstance-restored \
  --zone=us-central1-c \
  --tier=zonal \
  --network=name=default \
  --file-share=name=vol1,capacity=2TiB,source-backup=mybackup,source-backup-region=asia-east2 

What's next

Design a Mobile Site
View Site in Mobile | Classic
Share by: