Network and Storage Protocols

Ontap 9 CIFS shares and Snapmirror

GByte
5,855 Views

Is there a command you can use to migrate CIFs shares as you would have done during a 7-mode snapmirror migration using the "cifsconfig_share.cfg" file.

Is there no way to export and import the shares to the snapmirror destination?

1 ACCEPTED SOLUTION

Ontapforrum
5,798 Views

In cDOT/ONTAP there is no concept of "cifsconfig_share.cfg" file, so the file copying is not an option here as it was in 7-mode. Yes, SVM DR can do this for you as suggested. However, in case you don't want to do SVM DR and simply wants shares & share_level ACLs to be replicated/copied across,  following script can be used.

 

Using this script shares & share_level ACLs can be exported/backed and imported/restored to SnapMirrored destination volume. This 'ps script' comes handy especially if you have 'too many shares' and you don't want to create them manually along with it's share level permissions, which could be very laborious.

 

The script I am referring to is available at the following location. I happen to come across this script on Justin Parisi's blog post, courtesy:
https://whyistheinternetbroken.wordpress.com/2015/05/01/techusing-powershell-to-back-up-and-restore-cifs-shares-in-netapps-clustered-data-ontap/

 

Actual script is stored here:
https://github.com/DatacenterDudes/cDOT-CIFS-share-backup-restore

 

It may sound complicated but it's not and it does the same job as 7-mode config file would have, and works perfectly as it claims. I had tried this script then, and it worked perfectly.

 

Steps: {All the details are given in the script, takes less than 5 mints | * = all shares }

1) Run the ps backup script to Export/backup shares to - xml file.
PS C:\> .\backupSharesAcls.ps1 -server xxx.xxx.x.xxxx -user admin -password xxxxx -vserver vsdata5 -share * -shareFile c:\share.xml -aclFile c:\aclfile.xml -spit less

2) Break the snapmirror (Make it r/w)
3) Rename the volume in destimation SVM as the original source volume
4) Mount the original source volume in to the "Namespace" (This is necessary otherwise ps script will fail with 'unable to find path' error)
5) Run the ps restore script.
PS C:\> .\restoreSharesAcls.ps1 -server xxx.xxx.x.xxx -user admin -password xxxx -vserver cgprodsvm01 -shareFile c:\share.xml -aclFile c:\aclfile.xml -spit less
6) Click on the shares on the destination SVM, you should see all the shares being populated.

 

Thanks!

View solution in original post

3 REPLIES 3

SpindleNinja
5,833 Views

SVM-DR might be an option?  

Ontapforrum
5,799 Views

In cDOT/ONTAP there is no concept of "cifsconfig_share.cfg" file, so the file copying is not an option here as it was in 7-mode. Yes, SVM DR can do this for you as suggested. However, in case you don't want to do SVM DR and simply wants shares & share_level ACLs to be replicated/copied across,  following script can be used.

 

Using this script shares & share_level ACLs can be exported/backed and imported/restored to SnapMirrored destination volume. This 'ps script' comes handy especially if you have 'too many shares' and you don't want to create them manually along with it's share level permissions, which could be very laborious.

 

The script I am referring to is available at the following location. I happen to come across this script on Justin Parisi's blog post, courtesy:
https://whyistheinternetbroken.wordpress.com/2015/05/01/techusing-powershell-to-back-up-and-restore-cifs-shares-in-netapps-clustered-data-ontap/

 

Actual script is stored here:
https://github.com/DatacenterDudes/cDOT-CIFS-share-backup-restore

 

It may sound complicated but it's not and it does the same job as 7-mode config file would have, and works perfectly as it claims. I had tried this script then, and it worked perfectly.

 

Steps: {All the details are given in the script, takes less than 5 mints | * = all shares }

1) Run the ps backup script to Export/backup shares to - xml file.
PS C:\> .\backupSharesAcls.ps1 -server xxx.xxx.x.xxxx -user admin -password xxxxx -vserver vsdata5 -share * -shareFile c:\share.xml -aclFile c:\aclfile.xml -spit less

2) Break the snapmirror (Make it r/w)
3) Rename the volume in destimation SVM as the original source volume
4) Mount the original source volume in to the "Namespace" (This is necessary otherwise ps script will fail with 'unable to find path' error)
5) Run the ps restore script.
PS C:\> .\restoreSharesAcls.ps1 -server xxx.xxx.x.xxx -user admin -password xxxx -vserver cgprodsvm01 -shareFile c:\share.xml -aclFile c:\aclfile.xml -spit less
6) Click on the shares on the destination SVM, you should see all the shares being populated.

 

Thanks!

GByte
5,758 Views

Didn't use SVM DR since the SVM had multiple protocols associated and only CIFS volumes were being migrated.

Scripting provided the solution as required without too much delay.

 

Your input is much appreciated.

Thanx

Public