File Server Migration with Robocopy

  • Main
  • File Server Migration with Robocopy
< All Topics

Tutorial on how to perform File Server Migration with Robocopy for the following scenario

Migrate C:\FileShare from AD01 to ADC with file properties, like Data, Attributes, Time Stamps, NTFS Access Control List (ACL), Owner Information and Audit Information remained

Source ServerFolder
AVENTIS-AD01 (10.10.10.200)C:\FileShare
AVENTIS-ADC (10.10.10.202)C:\FileShare (The Destinatination Folder will be created automatically)

Robocopy Commands

Migrate File from Source to Destination with the Robocopy as below

Robocopy.exe C:\FileShare \\10.10.10.202\c$\FileShare /e /copyall /zb /tee /log+:C:\Temp\RoboCopy_%date:~-7,2%-%date:~-10,2%-%date:~-4,4%.txt /NP /r:3
  • /e – copy subdirectories, including empty ones
  • /copyall – Copies all file information
  • /zb – Uses restartable mode. If access is denied, this option uses Backup mode
  • /tee – force the output to the console windows and the log file
  • /log+ – Writes the status output to the log file (appends the output to the existing log file).
  • /np – Specifies that the progress of the copying operation (the number of files or directories copied so far) will not be displayed.
  • /r:3 – Specifies the number of retries on failed copies. The default value of n is 1,000,000 (one million retries).

Log the output to C:\Temp\RoboCopy_dd-mm-YYYY.txt with C:\Temp\RoboCopy_%date:~-7,2%-%date:~-10,2%-%date:~-4,4%.txt

Verification of copied NTFS permission & Audit information

Compare the NTFS Permission with NTFSSecurity PowerShell Module

Install-Module NTFSSecurity 
Import-Module NTFSSecurity 

Get-Item C:\FileShare | Get-NTFSAccess

    Path: C:\FileShare (Inheritance enabled)

Account                             Access Rights                       Applies to                Type                                IsInherited                         InheritedFrom                     
-------                             -------------                       ----------                ----                                -----------                         -------------                     
AVENTIS365\uat2                     FullControl                         ThisFolderSubfoldersAn... Allow                               False                               unknown paren                     
NT AUTHORITY\SYSTEM                 FullControl                         ThisFolderSubfoldersAn... Allow                               True                                unknown paren                     
BUILTIN\Administrators              FullControl                         ThisFolderSubfoldersAn... Allow                               True                                unknown paren                     
BUILTIN\Users                       ReadAndExecute, Synchronize         ThisFolderSubfoldersAn... Allow                               True                                unknown paren                     
BUILTIN\Users                       CreateDirectories                   ThisFolderAndSubfolders   Allow                               True                                unknown paren                     
BUILTIN\Users                       CreateFiles                         ThisFolderAndSubfolders   Allow                               True                                unknown paren                     
CREATOR OWNER                       GenericAll                          SubfoldersAndFilesOnly    Allow                               True                                unknown paren                     

Compare the Audit permission

Get-Item C:\FileShare | Get-NTFSAudit

    Path: C:\FileShare (Inheritance enabled)

Account                             Access Rights                       Applies to                Type                                IsInherited                         InheritedFrom                     
-------                             -------------                       ----------                ----                                -----------                         -------------                     
Everyone                            ReadAndExecute                      ThisFolderSubfoldersAn... Success                             False                                                                 

Table of Contents