Skip to main content

Restoring a single file, LUN, or NVMe namespace from a SnapMirror destination

You can restore a single file, LUN, a set of files or LUNs from a Snapshot copy, or an NVMe namespace from a SnapMirror destination volume. Starting with ONTAP 9.7, you can also restore NVMe namespaces from a SnapMirror Synchronous destination. You can restore files to the original source volume or to a different volume.

Before you begin

To restore a file or LUN from a SnapMirror Synchronous destination (supported starting with ONTAP 9.5), you must first delete and release the relationship.

About this task

The volume to which you are restoring files or LUNs (the destination volume) must be a read-write volume:

  • SnapMirror performs an incremental restore if the source and destination volumes have a common Snapshot copy (as is typically the case when you are restoring to the original source volume).

  • Otherwise, SnapMirror performs a baseline restore, in which the specified Snapshot copy and all the data blocks it references are transferred to the destination volume.

  1. List the Snapshot copies in the destination volume:volume snapshot show -vserver SVM -volume volume

    For complete command syntax, see the man page.

    Example

    The following example shows the Snapshot copies on the vserverB:secondary1 destination:
    cluster_dst::> volume snapshot show -vserver vserverB -volume secondary1

    Vserver Volume Snapshot State Size Total% Used%
    ------- ------ ---------- ----------- ------ ----- ------ -----
    vserverB secondary1 hourly.2020-01-25_0005 valid 224KB 0% 0%
    daily.2020-01-25_0010 valid 92KB 0% 0%
    hourly.2020-01-25_0105 valid 228KB 0% 0%
    hourly.2020-01-25_0205 valid 236KB 0% 0%
    hourly.2020-01-25_0305 valid 244KB 0% 0%
    hourly.2020-01-25_0405 valid 244KB 0% 0%
    hourly.2020-01-25_0505 valid 244KB 0% 0%

    7 entries were displayed.
  2. Restore a single file or LUN or a set of files or LUNs from a Snapshot copy in a SnapMirror destination volume: snapmirror restore -source-path SVM:volume|cluster://SVM/volume, ... -destination-path SVM:volume|cluster://SVM/volume, ... -source-snapshot snapshot -file-list source_file_path,@destination_file_path

    For complete command syntax, see the man page.
    Note
    You must run this command from the destination SVM or the destination cluster.

    Example

    The following command restores the files file1 and file2 from the Snapshot copy daily.2020-01-25_0010 in the original destination volume secondary1, to the same location in the active file system of the original source volume primary1:
    cluster_dst::> snapmirror restore -source-path vserverB:secondary1 -destination-path vserverA:primary1 -source-snapshot daily.2020-01-25_0010 -file-list /dir1/file1,/dir2/file2

    [Job 3479] Job is queued: snapmirror restore for the relationship with destination vserverA:primary1

    Example

    The following command restores the files file1 and file2 from the Snapshot copy daily.2020-01-25_0010 in the original destination volume secondary1, to a different location in the active file system of the original source volume primary1.

    The destination file path begins with the @ symbol followed by the path of the file from the root of the original source volume. In this example, file1 is restored to /dir1/file1.new and file2 is restored to /dir2.new/file2 on primary1:

    cluster_dst::> snapmirror restore -source-path vserverB:secondary1 -destination-path vserverA:primary1 -source-snapshot daily.2020-01-25_0010 -file-list /dir/file1,@/dir1/file1.new,/dir2/file2,@/dir2.new/file2

    [Job 3479] Job is queued: snapmirror restore for the relationship with destination vserverA:primary1

    Example

    The following command restores the files file1 and file3 from the Snapshot copy daily.2020-01-25_0010 in the original destination volume secondary1, to different locations in the active file system of the original source volume primary1, and restores file2 from snap1 to the same location in the active file system of primary1.

    In this example, the file file1 is restored to /dir1/file1.new and file3 is restored to /dir3.new/file3:

    cluster_dst::> snapmirror restore -source-path vserverB:secondary1 -destination-path vserverA:primary1 -source-snapshot daily.2020-01-25_0010 -file-list /dir/file1,@/dir1/file1.new,/dir2/file2,/dir3/file3,@/dir3.new/file3

    [Job 3479] Job is queued: snapmirror restore for the relationship with destination vserverA:primary1