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
- Go to the Filestore instances page
- Click the Filestore instance that you want to create a backup of.
- Click the Backups tab.
- Click Create backup.
- In the Backup ID field, type a name for the backup.
- For Region, select the Google Cloud region where you want the backup to be located.
- Optional: Add a description.
- In the Encryption section, select either a Google-managed encryption key or a Customer-managed encryption key.
- Optional: Click Add label to add labels to the backup.
- Click Create.
gcloud
- Install
gcloud. Update
gcloud components:gcloud components update
Run the following
gcloud filestore backups createcommand in a terminal window on your local machine. The--kms-keyflag 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
To view a list of all backups in your current project:
To see details about a backup, click the backup ID.
To delete a backup:
- Click the backup ID of the backup you want to delete.
- Click Delete.
- When prompted, type the backup ID.
- 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=VALUEpairs 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
- Learn how to restore file shares.
- Learn how to schedule backups using Cloud Scheduler.
- Learn more about backups, common use cases, and best practices.
- Learn about backups pricing.
- Learn how to set up alerts for low disk space and low backups quota.
- Learn about backups-related known issues.