How to migrate file server data with permissions using robocopy

Ahmed Essam 240 Reputation points
2023-03-28T16:01:40.8066667+00:00

Hello,

I've about 1 TB of data on windows server 2012 and we are planning to migrate to the new Windows Server 2022, how to use Robocopy to copy the data with permissions also is there a way to speed up the copying?

Thanks

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JohnyBenz 321 Reputation points
    2023-05-06T12:28:29.43+00:00

    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

    1 person found this answer helpful.
    0 comments No comments

  2. MotoX80 36,291 Reputation points
    2023-03-28T21:38:43.0766667+00:00

    As long as you are using Active Directory users and groups you can simply use the /sec switch to copy the permissions. Do you know if any local accounts are referenced in the permissions?

    Here is a good read.

    https://techcommunity.microsoft.com/t5/storage-at-microsoft/robocopy-mir-switch-8211-mirroring-file-permissions/ba-p/423662

    As to speed, RDP to one of the servers and run robocopy there. Don't robocopy from a workstation and reference 2 network drives.

    The "trick" for quick implementation is to run robocopy multiple times with the /mir switch. The first run will copy the bulk of the data. It may take some time to run. But subsequent runs should be much faster because you are only copying files that have been changed since the last robocopy run.

    After the first run, check the files and permissions on a few folders to verify that everything has been copied as you expect.

    When you are ready to cut over the users, set the share on the old server to read only (or remove the share completely) and run robocopy with /mir a final time to pick up any recent changes.

    https://lazyadmin.nl/it/robocopy-ultimate-guide/

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.