Copy CIFS share with the access rights


Can I Copy files and directories from a windows 2003 Server to a NetApp filer with all the NTFS access rights, CIFS Shares and the CIFS Shares Access rights of each CIFS share. I know I can copy files and directories with robocopy and keep the NTFS access rights. I also need to copy the CIFS shares and the CIFS shares access rights.



Re: Copy CIFS share with the access rights

Robust File Copy i.e. robocoy will copy the files and folders to the destination, but their CIFS access rights will not transfer. You need to do that manually yourself from the filer using cLI or filerview or system manager once copying is done.

I hope this helps.

warm regards,


If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Copy CIFS share with the access rights

I use "xxcopy" in "backup" mode (/backup) to transfer the bulk of the files and directories with all attributes (also need long filename /fl) then clean up all attributes by running BeyondCompare - both available as 30 day trial for once off use or relatively inexpensive if you need longer term. I usually add /sc to the paramater list to make sure all security comes across.

BeyiondCompare seems to be exceptionally powerful at moving all attributes to the target, and has a wonderful GUI that makes it easy to select directories to include or exclude.

The one trick is that the base cifs shared volume needs to have permission of everyone full control, I then make a directory that lies underneath that with administrator ownership and inheritted attributes disabled in "properties" "Security" "Advance" "Auditing".  If you fail to deal with inheritted attributes you won't get  a clean copy, and if you try acting on the root share level it seems unhappy.

Once you have carried out the copy you can browse the data structure in System Manager / CIFS and set mount points at various levels of the data structure you have copied in.  You can name those share points as you wish in the System Manager wizard. It does not change the directory names - so further runs of Beyond Compare can freshen up your CIFS copy, but you can then map drives in Windows Explorer from a client machine using the mount point names you set up in the System Manager wizard.

My experience is that xxcopy is far more powerful and reliable than robocopy. xxcopy has to be installed in an administrtor level command prompt, and run in the sam eway. When you do that you have no mapped network drives, so you need to then issue:

net use S: \\sourcesys\srcvol /u:adminuser

net use Z: \\fascifs\cifsvol  /u:adminuser

then xxcopy s: z: /backup /fl /sc /pb   (/pb give you a progress bar)

Once xxcopy does the bulk copy then use BeyoondCompare. If you find differences, you can then use the left to right or right to left "green arrow" in the GUI to copy files & attributes from one structure to the other. Take care you remember which way is source, which way is destination.

All of my experience ha sbeen in Windows 2008R2 64 bit environment, and certainly the versions of Robocopy are different between Windows versions.

Software from and for BeyondCompare.

Re: Copy CIFS share with the access rights

I also recommend Robocopy...

Simple and easy and does the work...

Re: Copy CIFS share with the access rights

We're using RoboCopy for this sort of migration.

robocopy "<sourcepath>\." "<destinationpath>\." /B /S /E /PURGE /COPY:DATSO /XD "System Volume Information"


Re: Copy CIFS share with the access rights


Thanks for your Input.

secure copy wil do the job

it can copy files, directories, ntfs security, shares, share security



Re: Copy CIFS share with the access rights

Hope not too late, but this may help new users...

I used the following script to achieve the migration of a Windows server to a Netapp CIFS. You just have to add the robocopy call to transfer files and directories.

$source is the Windows source server

$dest is the Netapp target server.

First robocopy all files and folder from your Windows Server to the NetApp volume.

Then replace "/vol/vol_cifs_1a/" by your volume (/vol/mpls001-test)

Change the path to permcopy

Run the script to copy share and ACL from Windows server to the NetApp.

     Param ($source, $dest)

     Import-module DataONTAP
     connect-nacontroller $dest

     $Share= Get-WmiObject win32_share -computer $source  | Where { $_ -match “share” }
     Foreach ($s in $Share)


       try {
                 $exist = Get-NaCifsShareAcl $
                  # Error <=> share doesn't exist                

                  $shrPath= "/vol/vol_cifs_1a/" + $s.path
                  Add-NaCifsShare -Share $s.Name -Path $s.Path -Comment $s.Description

                  # Call Permcopy (Windows toolkit) to copy ACL

                  c:\temp\ps\permcopy.exe \\$source $shrName \\$dest $shrName



Ce message a été modifié par: philippe_mouchet

Re: Copy CIFS share with the access rights


Could you please email me at sivar at ?
I would like to know more about your script and its capabilities.

Siva Ramanathan

Re: Copy CIFS share with the access rights

This option might be a little off the wall but it worked for what I needed.  My environment consisted of 3 TB of data that needed to be migrated with little to no downtime.  Robocopy would normally work but the incrementals took way too long for 3 TB and if for some reason the robocopy failed because of permissions being hosed somewhere down the directory chain I would have to manually take ownership and then pick up the robocopy where it left off.  That would take a lot of baby sitting.

here is what I did.  I got a temp license from Netapp for a Secondary SnapVault license for the filer, along with an OSSV (open system snapvault for windows) and installed that on the host.  Because OSSV keeps an internal database it knows of any files that have changed.  I ran OSSV on the windows host and let it do the initial dump of 3TB which took about 2 days.  After it was done I did an update which took about 4 hours.  After that I setup a schedule to OSSV any changes every hour.  When i was ready to cutover i did one last OSSV update which took about 20 min.  I then broke the relationship and turned the read-only qtree into a read-write qtree and presto.  All my perms and no missing data with little to no downtime.  Here is the link to turn a read-only snapvault into a read-writable volume.

Re: Copy CIFS share with the access rights

I think there was an issue with OSSV (only for migrations like this) when there was a local user on the server that the local SID isn't updated or something but can't remember... any local users and any issues once writable on the NetApp?  If no local users I think it was fine (and may actually be fixed now).  Nice to see a tool used for multiple purposes...meant for backup but useful for cutover too.