Skip to main content

volume snapshot restore-file

Contributors
Suggest changes

Restore a file from a snapshot

Availability: This command is available to cluster and Vserver administrators at the admin privilege level.

Description

The volume snapshot restore-file command enables you to restore a single file to a version saved in the Snapshot copy. You can restore a file over an existing copy of the file in the parent read-write volume or to a different location within the same parent read-write volume. If the destination file for the restore operation does not exist, a new file is created with the same version as the one saved in the Snapshot copy. If the destination file for the restore operation exists, then it is overwritten by the version from the Snapshot copy. This operation is used to restore normal user-level files, LUNs and NVMe namespaces. The command also supports restoring normal user-level files with streams. The command fails if you try to restore directories (and their contents). During the restore operation the parent read-write volume should remain online. The command fails if the destination path for the restore operation is in a different volume than the source volume.

Parameters

-vserver <vserver name> - Vserver Name

This specifies the Vserver which contains the volume.

[-volume <volume name>] - Volume Name

This specifies the volume which contains the specified Snapshot copy.

-s, -snapshot <snapshot name> - Snapshot Name

This specifies the Snapshot copy from which the file is restored.

-path <text> - Filepath

This specifies the relative path to the file which is restored from the Snapshot copy. You should specify the -volume option so that the file is searched and restored from the Snapshot copy of the specified volume. If you do not specify the -volume then the file is searched and restored from the Snapshot copy of the root volume.

[-r, -restore-path <text>] - Restore Filepath

This option specifies the destination location inside the volume where the file is restored. If you do not specify this option, the file is restored at the same location referred by -path option. If you specify -restore-path option, then it should refer to a relative path location within the same volume which contains the source file. If you do not specify -volume along with the relative path, the file is restored in the root volume.

[-split-disabled <true>] - Disable Space Efficient LUN Splitting

If you use this option and set it to true , space efficient LUN or NVMe namespace clone split is not allowed during the restore operation. If you use this option and set it to false or do not use this option, then space efficient LUN or NVMe namespace clone split is allowed during the restore operation.

[-ignore-streams <true>] - Ignore Streams

If you use this parameter, the file is restored without its streams. By default, the streams are restored.

Examples

The following example restores a file foo.txt from the Snapshot copy vol3_snap inside the volume vol3 contained in a Vserver vs0 :

cluster1::> volume snapshot restore-file -vserver vs0 -volume vol3 -snapshot vol3_snap -path /foo.txt