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](https://docs.cloud.google.com/filestore/docs/backups.md.txt).

## Before you begin

Before you begin creating backups, enable APIs and ensure the necessary roles and permissions are granted.
For more information, see [Get started with backups](https://docs.cloud.google.com/filestore/docs/backups-before-you-start.md.txt).

## Create a standard backup

To create a standard, on-demand, backup, follow these steps:

### Console

1. In Google Cloud console, go to the Filestore **Instances** page.

   [Go to Instances](https://console.cloud.google.com/filestore/instances)
2. Select the instance you want to back up from the table.

3. In the **Backups** tab, click **Create on-demand backup**.

4. Click **Next**.

5. In the **Backup ID** field, type a name for the backup.

6. In the **Region** field, select the Google Cloud region where you want the backup to be located.

7. Optional: Add a description.

8. In the **Encryption** section, select either a Google-managed encryption key or a Customer-managed encryption key.

   > [!NOTE]
   > **Note:** This step is not available for basic instances.

9. Optional: Click **Add label** to add labels to the backup.

10. Optional: Add tags for resource organization.

11. Click **Create**.

### gcloud

1. Install [`gcloud`](https://docs.cloud.google.com/filestore/docs/install.md.txt).
2. Update [`gcloud components`](https://docs.cloud.google.com/sdk/gcloud/reference/components/update):

   gcloud components update
3. Run the following [`gcloud filestore backups create`](https://docs.cloud.google.com/sdk/gcloud/reference/filestore/backups/create)
   command in a terminal window on your local machine. The `--kms-key` flag is optional:

   ```bash
   gcloud filestore backups create BACKUP_NAME \
   --instance=INSTANCE_NAME \
   --file-share=FILE_SHARE_NAME \
   --instance-location=INSTANCE_LOCATION \
   --region=BACKUP_LOCATION \
   --kms-key=projects/KMS_PROJECT/locations/KMS_LOCATION/keyRings/KEYRING/cryptoKeys/CRYPTO_KEY
   ```

Replace the following:

- <var translate="no">BACKUP_NAME</var> is the name you want to give the backup.
- <var translate="no">INSTANCE_NAME</var> is the name of the Filestore instance to back up.
- <var translate="no">FILE_SHARE_NAME</var> is the name of the file share on the Filestore instance.
- <var translate="no">INSTANCE_LOCATION</var> is the region or zone where the Filestore instance is located.
- <var translate="no">BACKUP_LOCATION</var> 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.
- <var translate="no">KMS_PROJECT</var> is the project name where the KMS key resource is stored.
- <var translate="no">KMS_LOCATION</var> is the region of the KMS key resource.
- <var translate="no">KEYRING</var> is the name of the key ring.
- <var translate="no">CRYPTO_KEY</var> 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:

```bash
  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
```

## View backups

To view on-demand backups and their details, follow these steps:

### Console

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

   [Go to Backups](https://console.cloud.google.com/filestore/backups)
2. Click **Standard** tab to view a list of backups.

3. Click the backup name to view the details of the specific backup.

### gcloud

### List all backups in your current project

To view a list of backups for your current project, run the [`backups list`](https://docs.cloud.google.com/sdk/gcloud/reference/filestore/backups/list)
command:

```bash
  gcloud filestore backups list
```

### View information about a backup

To view information about a backup, run the [`backups describe`](https://docs.cloud.google.com/sdk/gcloud/reference/filestore/backups/describe)
command:

```bash
  gcloud filestore backups describe BACKUP_NAME \
    --region=BACKUP_LOCATION
```

Replace the following:

- <var translate="no">BACKUP_NAME</var> is the name of the backup whose information you want to view.
- <var translate="no">BACKUP_LOCATION</var> is the region where the backup is stored.

## What's next

- Learn how to [create standard and enhanced backups](https://docs.cloud.google.com/filestore/docs/backup-data).
- Learn how to [restore standard and enhanced backups](https://docs.cloud.google.com/filestore/docs/restore-data.md.txt).
- Explore [differences between standard and enhanced backups](https://docs.cloud.google.com/filestore/docs/backups.md.txt#standard-enhanced-backups).