ONTAP Discussions

How to restore a directory from snapshot

ACHOU_SIMG
8,241 Views

ONTAP 9.1RC1

 

Hi,

 

Is there a way to easily restore a directory in a volume from snapshots without involving clients (e.g. cp)? The volume is exported via NFS only and the directory contains many subdirectories and files. It looks like snapshot restore-file only applies to single file. Its man page says:

 

The command fails if you try to restore directories (and their contents).

 

Thanks,

1 ACCEPTED SOLUTION

robinpeter
8,222 Views

Directry level restore is not possible form snapshots.

 

the easiest way is browse though the snapshot, find the directory you want.

copy and paste-replace or copy as paste-new-dir-name.

 

If the copy operation going to take a while, ill recommend you rename the snapshots

In Ontap 7-Mode snapshots are named hourly.0 or daily.0

if the copy operation going to take more than hour, before it complete your hourly.0 could 

renamed to hourly.1 by ontap, and your copy operation will fail. To avoid that rename the snapshot to something thats not use by ontap.

 

robin.

 

 

View solution in original post

1 REPLY 1

robinpeter
8,223 Views

Directry level restore is not possible form snapshots.

 

the easiest way is browse though the snapshot, find the directory you want.

copy and paste-replace or copy as paste-new-dir-name.

 

If the copy operation going to take a while, ill recommend you rename the snapshots

In Ontap 7-Mode snapshots are named hourly.0 or daily.0

if the copy operation going to take more than hour, before it complete your hourly.0 could 

renamed to hourly.1 by ontap, and your copy operation will fail. To avoid that rename the snapshot to something thats not use by ontap.

 

robin.

 

 

Public