First, make sure both the source and destination folders are shared and accessible.
This is an example command to migrate the files server ( Windows Server 2012 ) to a Windows Server 2022 with preserving permissions :
robocopy "C:\source\path" "\\destination\server\path" /E /Z /COPY:DATSOU /R:5 /W:5 /MT:8 /LOG:"C:\log\path\robocopy.log"
-
/E
: Copy subdirectories, including empty ones. -
/Z
: Copy files in restartable mode, which can resume partially copied files if the copy process is interrupted. -
/COPY:DATSOU
: Copy Data, Attributes, Timestamps, Security (NTFS ACLs), Owner info, and Auditing info. -
/R:5
: Retry 5 times if a file cannot be copied (default is 1 million). -
/W:5
: Wait 5 seconds between retries (default is 30 seconds). -
/MT:8
: Use multithreading to speed up the copy process by using 8 threads (can be set to a number between 1 and 128; the default is 8).
To speed up the copying process, you can adjust the number of threads with the /MT
switch.
On the other hand, you can do the file migration with keeping the permissions and with high-speed performance using a third party like Resilio or Gs Richcopy360, both are great to save time and full-featured