OpenStack Discussions

Netapp powershell | Restore file using snapshot

Khulbe
2,522 Views

Hello Team,

 

I have Netapp powershell tool kit and trying to automate file restore operation using snapshot. I have found below 

 

Restore-NcCifsShadowCopyDirectory 

Restore-NcSnapshotFile

 

However, I am not bale to successfully restore the file.  For example :

 

PS C:> Restore-NcSnapshotFile

cmdlet Restore-NcSnapshotFile at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Path: /volume/text.txt
SnapName: weekly.2020-06-21_0015

Restore file from snapshot
Are you sure you want to restore file /volume/test.txt from snapshot weekly.2020-06-21_0015?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Restore-NcSnapshotFile : Failed to restore file from Snapshot copy weekly.2020-06-21_0015 for volume
"volc1svm1_root" on Vserver "vserverc1svm1". Reason: Inappropriate file type or format.
At line:1 char:1
+ Restore-NcSnapshotFile
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (10.181.209.22:NcController) [Restore-NcSnapshotFile], EONTAPI_
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.RestoreNcSnapshotFile

1 ACCEPTED SOLUTION

aladd
2,467 Views

If you've already connected to the vserver using connect-nccontroller, try using the restore-ncsnapshotfile command like this:

 

restore-ncsnapshotfile /vol/{volume_name}/test.txt weekly.2020-06-21_0015

 

let me know if it works out.

 

-Adam

View solution in original post

1 REPLY 1

aladd
2,468 Views

If you've already connected to the vserver using connect-nccontroller, try using the restore-ncsnapshotfile command like this:

 

restore-ncsnapshotfile /vol/{volume_name}/test.txt weekly.2020-06-21_0015

 

let me know if it works out.

 

-Adam

Public