Copy NTFS permissions from one folder/file to another

This content is 8 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

I’m working with a customer who is migrating from on-premises datacentres to the cloud – using a virtual datacentre in Microsoft Azure. One of the challenges we have is around the size of the volumes on a file server: Azure has a maximum disk size of 1023GB and the existing server has a LUN attached that exceeds this size.

We can use other technologies in Windows to expand volumes over multiple disks (breaking the <1TB limit) but the software we intend to use for the migration (Double Take Move) needs the source and target to match. That means that the large volume needs to be reduced in size, which means moving some of the data to a new volume (at least temporarily).

One of my colleagues moved the data (using a method that retained permissions) but the top level folders that he created were new and only had inherited permissions from their parent. After watching him getting more and more frustrated, manually configuring access control lists and comparing them in the Windows Explorer GUI, I thought there had to be a better way.

A spot of googling turned up some useful information from forums and this is what I did to copy NTFS permissions from the source to the target (thanks to Kalatzis Stefanos for his answer on Server Fault).

First of all, export the permissions from the source folder with the icacls.exe command:

icacls D:\data /save perms.txt [/t /c]

/c is continue on error; /t is to work through subfolders too

Then, apply these permissions to the target volume. They can be applied at volume level, because the export includes the file names and an associated ACL (i.e. it only applies to matching files)

icacls D:\ /restore perms.txt

But what if the source and destination folders/files have different names? That’s answered by Scott Chamberlain in another post, which tells me I can just edit my perms.txt file and change the file/folder name before each ACL.

By following this, I was able to export and re-apply permissions on several folders in a few minutes. Definitely a time saver!

4 thoughts on “Copy NTFS permissions from one folder/file to another

  1. NTFS is the popular file permission right now. Earlier, we had FAT32 which does not allowed to copy files larger than 4 GB. So this is the solution to that but there is another problem how to copy NTFS permission with the file transfer. For this I have tried many software and I found 1 or 2 being good at what they say. But my friend suggested me to use GS Richcopy 360. By using it for almost 6 months I can say that its the best among others. Try it, hope it helps!

  2. Gs RichCopy360 and Carbonite are ideal to copy all these kinds of permissions, both have many and helpful features.
    Good luck

  3. @Jim Fortosin – there’s a polite way to ask for help and then there’s calling BS, which got your comment moved to the bin for a while until I realised what you were saying.

    [] is pretty standard for indicating optional parameters in help text. Remove the [ and you should find it works.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.