Back up data

This page shows you how to back up data for disaster recovery using Filestore backups. To learn more about backups, common use cases, and best practices, see Backups .

Before you begin

Ensure that the account you are using has either the Cloud Filestore Editor role, or the Project Owner or Project Editor basic role. For more information about roles and permissions for Filestore, see Access Control , IAM permissions , or About supported protocols .

Back up a file share

Backed up data include all the file system data and metadata. Filestore backups don't include file locks and certain instance-specific information . The following table shows what instance information backups preserve and what information they don't:

Preserved Not preserved
Instance ID Description
Tier of the source instance Location
Capacity Network
File share name IP address
Creation time
IP-based access controls
File locks
Lock state
Snapshots

Create a backup

You can create a backup of a file share using one of the following methods:

Console

  1. Go to the Filestore instances page
  2. Click the Filestore instance that you want to create a backup of.
  3. Click the Backupstab.
  4. Click Create backup.
  5. In the Backup IDfield, type a name for the backup.
  6. For Region, select the Google Cloud region where you want the backup to be located.
  7. Optional: Add a description.
  8. In the Encryptionsection, select either a Google-managed encryption key or a Customer-managed encryption key.
  9. Optional: Click Add labelto add labels to the backup.
  10. Click Create.

gcloud

  1. Install gcloud .
  2. Update gcloud components :

    gcloud components update

  3. Run the following gcloud filestore backups create command in a terminal window on your local machine. The --kms-key flag is optional:

     gcloud filestore backups create BACKUP-NAME 
    \
    --instance= INSTANCE-NAME 
    \
    --file-share= FILE-SHARE-NAME 
    \
    --instance-zone= ZONE 
    \
    --region= BACKUP-LOCATION 
    \
    --kms-key=projects/ KMS-PROJECT 
    /locations/ KMS-LOCATION 
    /keyRings/ KEYRING 
    /cryptoKeys/ CRYPTO-KEY 
     
    

where:

  • BACKUP-NAME is the name you want to give the backup.
  • INSTANCE-NAME is the name of the Filestore instance to back up.
  • FILE-SHARE-NAME is the name of the file share on the Filestore instance.
  • ZONE is the zone where the Filestore instance is located.
  • BACKUP-LOCATION is the region where the backup will be stored. If a region is not indicated, the backup is created in the same region as the Filestore instance.
  • KMS-PROJECT is the project name where the KMS key resource is stored.
  • KMS-LOCATION is the region of the KMS key resource.
  • KEYRING is the name of the key ring.
  • CRYPTO-KEY is the KMS key resource.

Example

The following command creates a backup of file share vol1 on the Filestore instance nfs-server , which is located in zone us-central1-c . The backup is named mybackup , is located in region asia-east2 , and has an associated encryption key that will encrypt the instance when restored:

 gcloud filestore backups create mybackup \
  --instance=nfs-server \
  --file-share=vol1 \
  --instance-zone=us-central1-c \
  --region=asia-east2 \
  --kms-key=projects/purple-project/locations/us-central1/keyRings/filestore-keyring/cryptoKeys/filestore-key 

List, view, update, and delete backups

Filestore backups can be listed, viewed, updated, and deleted.

Console

  1. To view a list of all backups in your current project:

    Go to the Filestore backups page

  2. To see details about a backup, click the backup ID.

  3. To delete a backup:

    1. Click the backup ID of the backup you want to delete.
    2. Click Delete.
    3. When prompted, type the backup ID.
    4. Click Delete.

gcloud

List all backups in your current project

To view a list of backups for your current project, run the backups list command:

 gcloud filestore backups list 

View information about a backup

To view information about a backup, run the backups describe command:

 gcloud filestore backups describe BACKUP-NAME 
\
  --region= BACKUP-LOCATION 
 

Where:

  • BACKUP-NAME is the name of the backup whose information you want to view.
  • BACKUP-LOCATION is the region where the backup is stored.

Update a backup

To update a backup, run the backups update command:

gcloud  
filestore  
backups  
update  
 BACKUP-NAME 
  
 \ 
  
--region = 
 BACKUP-LOCATION 
  
 \ 
  
--description = 
 " NEW-DESCRIPTION 
" 
  
 \ 
  
--update-labels = 
  KEY 
 = 
VALUE,... 

Where:

  • BACKUP-NAME is the name of the backup whose information you want to view.
  • BACKUP-LOCATION is the region where the backup is stored. The region cannot be changed.
  • NEW-DESCRIPTION is the description of the backup.
  • KEY=VALUE,... is a list of KEY=VALUE pairs you want to update. If a label exists, its value is updated, otherwise a new label is created.

Delete a backup

To delete a backup, run the backups delete command:

gcloud  
filestore  
backups  
delete  
 BACKUP-NAME 
  
 \ 
  
--region = 
 BACKUP-LOCATION 

Where:

  • BACKUP-NAME is the name of the backup whose information you want to view.
  • BACKUP-LOCATION is the region where the backup is stored.

What's next

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