How copy files between windows servers

Product:
Planning Analytics 2.0.5
Microsoft Windows 2016 server

Problem:
How do i copy files from one server to another server and keep the NTFS security?

Solution:
Check you have a file share on source server.
Create a file share on destination server.
Give everyone full access to the share.
Ensure that the user running the script is local administrator on both servers
Open notepad
Enter below line (modify it for your server names)
robocopy \\serverSource\ShareA \\serverDestination\ShareA /MIR /COPYALL /DCOPY:T /R:1 /W:1 /NP /TEE /LOG:d:\temp\ShareA-RobocopyResults.log
Save file as d:\temp\robocopyfiles.cmd

Open a command prompt as administrator
move to the folder where the script is
run
robocopyfiles.cmd

Check the log files for errors when it is done.

(solution is from this site https://social.technet.microsoft.com/Forums/en-US/3c42061c-d739-4c44-90ec-014b0e08c45c/how-to-copy-file-security-permissions-from-one-server-to-another-one-by-using-robocopy?forum=winserverfiles)
======================
TITLE “Copying ShareA from TestSource to TestDestination”
robocopy \\TestSource\ShareA \\TestDestination\ShareA /MIR /COPYALL /DCOPY:T /R:1 /W:1 /NP /TEE /LOG:C:\Logs\ShareA-RobocopyResults.log
PAUSE
======================

The switch functions are as follows:

/MIR – Creates a mirror copy.

/COPYALL – Copies ALL file attributes

/DCOPY – Copies (ie retains original) Directory Creation/Modified Timestamps. If you don’t include this, all directories will be recreated with NEW timestamps

/R:1 – Retry copy once on failure

/W:1 – Wait 1 second between retries

/NP – No Percentage Completion written to output

/TEE – Output progress to Command Window (I guess TEE = Terminal Emulation)

/LOG – Write out and save to a specified Log File

More information:
https://community.spiceworks.com/topic/278298-move-shared-folders-and-retain-file-and-share-permissions-with-robocopy