Perform a selective file restore

This page describes how to perform a selective file restore.

Before you begin

Review the following prerequisites before you perform a selective file restore:

  • Snapshot configuration: the snapshot directory of the target volume to which the restore is initiated must be visible. In the Create new volume from backup page, select the Make snapshot directory visible checkbox. For more information, see Create a new volume.

  • Google Cloud CLI version: to access selective file restore, make sure your Google Cloud CLI version is at least 2025.08.08. This feature is exposed under the beta component and needs to be installed as part of the Google Cloud CLI suite.

    To verify and update Google Cloud CLI version:

    1. Check your Google Cloud CLI version:

      gcloud --version
      
    2. If the beta component isn't installed, run:

      gcloud components install beta
      
    3. If your Google Cloud CLI version is older than 2025.08.08, update it:

      gcloud components update beta
      

Perform a selective file restore

You can use selective file restore to recover files in the following ways:

  • Restore files to the source volume and the same source directory.

  • Restore files to the source volume in a different directory.

  • Restore files to a new volume in a directory of your choice.

Selective file restore supports both in-region and cross-region backups. This procedure describes two different cases:

Case 1: In-region restore to the source volume in the same source directory

Use the following instructions to perform an in-region selective file restore using the Google Cloud CLI.

gcloud

To perform a selective file restore:

gcloud beta netapp volumes restore-backup-files DESTINATION_VOLUME_NAME \
  --location=LOCATION --project=PROJECT_ID \
  --backup=projects/PROJECT_ID/locations/LOCATION/backupVaults/VAULT_NAME/backups/BACKUP_NAME \
  --file-list=FILE_LIST \
  --restore-destination-path=RESTORE_DESTINATION_PATH

Replace the following information:

  • DESTINATION_VOLUME_NAME: the name of the destination volume for the restore operation. This can be the original volume from which the backup was taken or a new volume.

  • LOCATION: the region where the volume resides.

  • PROJECT_ID: the ID of the project where the volume and storage pool is created.

  • VAULT_NAME: the name of the backup vault. Both in-region and cross-region backup vaults are supported.

  • BACKUP_NAME: the name of the backup which contains the files to be restored.

  • FILE_LIST: a comma-separated list of file paths in the chosen backup which needs to be restored.

  • RESTORE_DESTINATION_PATH: Optional: the specific path where the files will be restored. If no path is provided in this parameter, an in-place restore is performed.

Example:

Consider a selective file restore operation performed on a backup of a source volume named sfr-demo-vol-1. This source volume is backed up to sfr-demo-backup-1 within the backup vault named sfr-demo-vault-in-region.

The source volume contains three text files:

  • 1.txt

  • 2.txt

  • directory/3.txt

A backup, sfr-demo-backup-1, has been identified within the in-region backup vault.

Scenario: The file directory/3.txt and its parent directory are removed from the source volume. A restore operation is then performed with specific parameters.

Attempt 1: Restore the file without re-creating the directory in the source volume.

First, an attempt is made to restore file directory/3.txt without re-creating the directory in the source volume. This attempt is expected to fail.

Restore the file:

gcloud beta netapp volumes restore-backup-files sfr-demo-vol-1
--location=us-central1 --project=my-project
--backup=projects/my-project/locations/us-central1/backupVaults/sfr-demo-vault-in-region/backups/sfr-demo-backup-1
--file-list=/directory/3.txt --restore-destination-path=/directory/

You will be prompted to confirm the restore operation:

You are about to restore files from a backup to Volume
projects/my-project/locations/us-central1/volumes/sfr-demo-vol-1.
Are you sure?

Do you want to continue (Y/n)? Y

The operation fails with the following error:

Waiting for [operation-1758047951007-63eef6f9e2f5d-40212146-348595a4] to finish...failed.
ERROR: (gcloud.beta.netapp.volumes.restore-backup-files) bad request error: "Error when create - FAILED - The Single File Backup Restore cannot be processed due to invalid destination path/directory."

Attempt 2: Restore the file after re-creating the directory.

Create the directory again in the source volume and run the same restore command. This time, the operation is successful.

Restore the file:

gcloud beta netapp volumes restore-backup-files sfr-demo-vol-1
--location=us-central1 --project=my-project
--backup=projects/my-project/locations/us-central1/backupVaults/sfr-demo-vault-in-region/backups/sfr-demo-backup-1
--file-list=/directory/3.txt --restore-destination-path=/directory/

You will be prompted again to confirm the restore operation:

You are about to restore files from a backup to Volume
projects/my-project/locations/us-central1/volumes/sfr-demo-vol-1.
Are you sure?

Do you want to continue (Y/n)?  y

The operation completes successfully:

Waiting for [operation-1758048175178-63eef7cfac198-a94afb9b-913b60d5] to finish...done.
'@type': type.googleapis.com/google.cloud.netapp.v1beta1.RestoreBackupFilesResponse

Case 2: Cross-region restore to a new volume in a new directory

Use the following instructions to perform a cross-region selective file restore using the Google Cloud CLI.

gcloud

To perform a selective file restore:

gcloud beta netapp volumes restore-backup-files DESTINATION_VOLUME_NAME \
  --location=LOCATION --project=PROJECT_ID \
  --backup=projects/PROJECT_ID/locations/LOCATION/backupVaults/VAULT_NAME/backups/BACKUP_NAME \
  --file-list=FILE_LIST \
  --restore-destination-path=RESTORE_DESTINATION_PATH

Replace the following information:

  • DESTINATION_VOLUME_NAME: the name of the destination volume for the restore operation. This can be the original volume from which the backup was taken or a new volume.

  • LOCATION: the region where the volume resides.

  • PROJECT_ID: the ID of the project where the volume and storage pool is created.

  • VAULT_NAME: the name of the backup vault. Both in-region and cross-region backup vaults are supported.

  • BACKUP_NAME: the name of the backup which contains the files to be restored.

  • FILE_LIST: a comma-separated list of file paths in the chosen backup which needs to be restored.

  • RESTORE_DESTINATION_PATH: Optional: the specific path where the files will be restored. If no path is provided in this parameter, an in-place restore is performed.

Example:

Consider a selective file restore operation performed on a backup of a source volume named sfr-demo-vol-2. This source volume is backed up to sfr-demo-backup within the backup vault named sfr-demo-vault-cross-region.

The source volume contains two text files:

  • 1.txt

  • 2.txt

A backup, sfr-demo-backup, has been identified in a cross-region backup vault, with us-central1 as the source region and us-east4 as the destination region. After the backup was created, the file 1.txt was removed from the source volume.

The file 1.txt from sfr-demo-backup will be restored to a new volume named sfr-demo-vol-3 in a new directory called test.

Restore the file:

gcloud beta netapp volumes restore-backup-files sfr-demo-vol-3
--location=us-central1 --project=my-project
--backup=projects/my-project/locations/us-central1/backupVaults/sfr-demo-vault-cross-region/backups/sfr-demo-backup
--file-list=/1.txt --restore-destination-path=/test

You will be prompted to confirm the restore operation:

You are about to restore files from a backup to Volume
projects/my-project/locations/us-central1/volumes/sfr-demo-vol-3.
Are you sure?

Do you want to continue (Y/n)?  y

After confirmation, the operation is successful.

Waiting for [operation-1758050930422-63ef02134743f-8761c12f-b05a405e] to finish...done.
'@type': type.googleapis.com/google.cloud.netapp.v1beta1.RestoreBackupFilesResponse