[Samba] Migration of files with Windows ACL's to Samba server

Nick Couchman nick.e.couchman at gmail.com
Thu Jul 20 11:50:10 UTC 2023

On Thu, Jul 20, 2023 at 7:08 AM Borut Rozman via samba
<samba at lists.samba.org> wrote:
> Hi there,
> It might that this question was already answered but I can't really
> find any proper documentation for this.
> I am in a process of migrating about 70T of files from our Win2016
> storage server to a Samba (2:4.17.9+dfsg-0+deb12u3) server. Whilst
> doing this I want to preserve all the ACL's which were set on Windows
> shares.
> Is there any related documentation around this topic how to approach
> this so the permissions are preserved.
> We used this command to copy the data from one to another share:
> robocopy <Source> <Destination> /MIR /DCOPY:T /MT:3 /XJ /R:1 /W:3 /NDL
> /NP /LOG+:logfile.txt

Assuming that you have Samba set up to properly store the Windows ACLs
with your choice of VFS module, your robocopy command just needs a few
extra flags. I usually do something like:

robocopy /mir /copy:datso /dcopy:dat /r:0 /ndl /mt <src> <dest>

The /copy:datso flag copies (d)ata, (a)ttributes, (t)imestamps,
(s)ecurity, and (o)wnership, which should capture everything you need.
On /dcopy, this copies data, attributes, and timestamps associated
with the directory. This should cover everything. If you still have
issues with permissions not being properly copied, you can use /sec
and /secfix to try to force robocopy to do the job. In my dayjob, my
team has used this method to migrate several hundred terrabytes of
data from Windows file servers to a couple of different Linux/Samba
platforms with very good success.


More information about the samba mailing list