File share migration – Phase 2 – Robocopy
Following Phase 1 of file share discovery, phase 2 will do the initial seeding and copying of all data from the older Windows 2003 file server to the newer Windows 2012 R2 file server. The script can be downloaded from the Microsoft script center repository.
The same script can be used to run a refresh of the data. It will copy newer and changed files every time it runs. If interrupted, the script can simply be run again. Again only newer or changed files will be copied.
- The same drives must exist on the new 2012 R2 server as the old 2003 server. So, if we have drive letters F, H, M on the older server we must have the same drive letters on the new server.
- The drives on the new servers must have enough disk space to accommodate all copied data. If the drives on the new file server are formatted using a larger allocation unit size such as 64 KB, actual disk space used on the new server may exceed disk space used on the old server particularly if copying many files under 64 KB each.
Here’s an example output when running this script:
- Robocopy copies NTFS permissions on files and folders assigned to domain users and groups. It will not copy permissions to files and folders assigned to local users or groups.
- Robocopy is unaware of inherited NTFS permissions, and will not copy inherited permissions. This is why this script starts from the root of each drive letter to ensure that all NTFS permissions are captured.
- This script is intended to run in the context of a domain user account with local administrative permissions on both the source and target servers.
- Robocopy will copy files with paths longer than 256 characters
- Depending on how much data is being copied, network speed, storage subsystem speed, and whether /IPG option is used with Robocopy to throttle down the copy process, this can take several hours, days, or weeks.
Robocopy options used:
- /XJ :: eXclude Junction points. (normally included by default).
- /R:0 :: number of Retries on failed copies. This is set to not retry failed files. Failed files will be addressed in next phases of the file migration.
- /W:0 :: Wait time between retries: default is 30 seconds. Choosing no waiting here. Again will be addressed in next phases.
- /IT :: Include Tweaked files (A Tweaked file is defined to be one that exists in both the source and destination, with identical size and time stamp, but different attribute settings).
- /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).
- /COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).
- /NP :: No Progress – don’t display percentage copied.
- /TEE :: output to console window, as well as the log file.
- /ZB :: use restartable mode; if access denied use Backup mode.
- /LOG+:file :: output status to LOG file (append to existing log).
Since this will be run against production servers, you may want to consider the /IPG option:
/IPG:n :: Inter-Packet Gap (ms), to free bandwidth on slow lines.
For example, using /IPG:100 will slow down copying by waiting 100 ms between each packet to reduce the load on the source server. This will also make the migration process and file copy longer.