How to use Robocopy to move/migrate folder(s)/directory(ies) from one server

Robocopy is a Windows command line tool used to make copies of files and folders. This is one of my favourite tools, and it comes free as part of Windows Server Resource kit – or can be downloaded from Microsoft’s web site(rktools.exe – 11.8M). It has been part of Windows OS from Windows Vista.

Robocopy provides the ability to make mirror copies of folders/directories as well as to synchronise file(s) by copying any changes after comparing a file’s size or time stamp. It also provides the ability to copy locked file(s) i.e file(s) in use, which is not possible with Xcopy or the Copy command.

Below is the Robocopy usage

Robocopy source destination [File [file] … ] [options]

Source Source directory path (i.e local or network path)
Destination Destination directory path (i.e local or network path)
File Name of file to act upon
Options Options to use to accomplish the intended task

For more information on options usage, please visit Microsoft Technet page. (Note:Page opens in new window).

To use “Robocopy” to move/migrate folder(s)/directory(ies) from one server to another or to another location.

Run the command below at the command prompt (This ensures that Robocopy is located at c:\Windows\System32)

robocopy source_location target_location /MIR /E /Z /LOG:C:\Robocopylog.txt /TEE /R:2 /W:0

/MIR Mirrors a directory tree
/E Copies all subdirectories including empty ones.
/Z Copies files in restartable mode (that is, restarts the copy process from the point of failure).
/LOG: Generates a log file name robocopylog.txt
/TEE Logs to file as well as to the console
/R:0 Number of times to retry copying a locked file
/W:0 Time in between retry attempts

Windows Server 2012 Unleashed
Windows Server 2012 Unleashed - Hardcover (1680 pages)
by Rand Morimoto, Michael Noel, Guy Yardeni, Omar Droubi, Andrew Abbate, Chris Amaris
Price: £18.10
35 new from £18.107 used from £22.88
This is the most comprehensive and realistic guide to Windows Server 2012 planning, design, prototyping, implementation, migration, administration, and support. Extensively updated, it contains unsurpassed independent and objective coverage of Windows Server 2012's key innovations, including improved virtualization components, enhanced security tools, new web and management resources, and Windows 8 integration. Windows Server 2012 Unleashed reflects the authors' extraordinary experience implementing Windows Server 2012 in large-scale environments since its earliest alpha releases, reaching back more than two years prior to its official launch. Microsoft MVP Rand Morimoto and his colleagues fully address every aspect of deploying and operating Windows Server 2012, including Active Directory, networking and core application services, security, migration from Windows Server 2003/2008, administration, fault tolerance, optimization, troubleshooting, and much more. Valuable for Windows professionals at all skill levels, this book will be especially indispensable for intermediate-to-advanced level professionals seeking expert, in-depth solutions.Every chapter contains tips, tricks, best practices, and lessons learned from actual deployments: practical information for using Windows Server 2012 to solve real business problems.* Plan and migrate from Windows Server 2003 and 2008 * Leverage powerful capabilities that are truly new in Windows Server 2012 * Install Windows Server 2012 and the GUI-less Windows Server Core * Upgrade to Windows Server 2012 Active Directory * Utilize advanced AD capabilities including federated forests and identity management * Plan and deploy network services, from DNS and DHCP to IPv6, IPAM, and IIS * Protect systems and data with server-level security, transport-level security, and security policies * Deliver true end-to-end secured anytime/anywhere access to remote/mobile clients * Efficiently configure and manage users, sites, OUs, domains, and

Post Comment