Skip to content
ShabazTech

Notes of an IT Pro

ShabazTech

Notes of an IT Pro

  • Microsoft Azure
    • Compute
    • Governance
    • Identity
    • Networking
    • Security
    • Storage
  • Microsoft Entra ID
    • Identity
      • Application Management
      • Governance
    • Security
      • Authentication
      • Conditional Access
    • Global Secure Access
      • Internet Access
      • Private Access
  • Microsoft Intune
    • Apps
      • Microsoft365 Apps For Enterprise
    • Devices
      • Windows Clients
    • Monitoring
    • Security
  • Microsoft 365
    • Defender XDR
    • Purview
  • Microsoft OnPrem
    • AD DS
    • Failover Clustering
    • Hyper-V
    • Powershell
    • SQL Server
      • SQL Server 2008R2
      • SQL Server 2012
      • SQL Server 2016
    • System Center Configuration Manager
      • SCCM 2012R2
    • Windows Clients
    • Windows Server
      • Windows Server 2008R2
      • Windows Server 2012
      • Windows Server 2012R2
      • Windows Server 2016
  • Citrix
    • XenApp 6.5
    • XenApp and XenDesktop 7.6 LTSR
    • XenApp and Xendesktop 7.15 LTSR
  • About The Author
  • Microsoft Azure
    • Compute
    • Governance
    • Identity
    • Networking
    • Security
    • Storage
  • Microsoft Entra ID
    • Identity
      • Application Management
      • Governance
    • Security
      • Authentication
      • Conditional Access
    • Global Secure Access
      • Internet Access
      • Private Access
  • Microsoft Intune
    • Apps
      • Microsoft365 Apps For Enterprise
    • Devices
      • Windows Clients
    • Monitoring
    • Security
  • Microsoft 365
    • Defender XDR
    • Purview
  • Microsoft OnPrem
    • AD DS
    • Failover Clustering
    • Hyper-V
    • Powershell
    • SQL Server
      • SQL Server 2008R2
      • SQL Server 2012
      • SQL Server 2016
    • System Center Configuration Manager
      • SCCM 2012R2
    • Windows Clients
    • Windows Server
      • Windows Server 2008R2
      • Windows Server 2012
      • Windows Server 2012R2
      • Windows Server 2016
  • Citrix
    • XenApp 6.5
    • XenApp and XenDesktop 7.6 LTSR
    • XenApp and Xendesktop 7.15 LTSR
  • About The Author
Close

Search

Subscribe
MicrosoftWindows ServerWindows Server 2008R2Windows Server 2012

Migrate File Server from Server 2003 to 2008R2 or 2012

By Shabaz
April 13, 2014 4 Min Read
6
Updated on March 14, 2016



Although the title of the post mentions migrating the file server role, its really rather about migrating the data from an old Server 2003 file server to a new 2008 R2 or 2012 file server. The procedure for moving the data is the same, whether you are migrating to Server 2008 R2 or Server 2012. The data will be moved by utilizing the robocopy command-line tool.

Personally I like to move data in two steps. A couple of weeks before the old server is decommissioned, I perform an initial copy of data. Then the day before the old server is decommissioned, I copy the data for the final time. When I copy the data for the final time, I also use the /mir switch, which removes data on the destination folder, if it does not exist on the source any more.

All robocopy operations are incremental in nature. Which means that only new files/folders, or files that have changed will be copied. Obviously when you perform a robocopy operation for the first time, all folders and files are new on the destination server.

1. Syntax of Robocopy

The syntax for robocopy is robocopy source_folder destination_folder [File Selection Options] [Copy/logging/other options]
robo1

Personally I have never had any use for File Selection options.

2. Initial copy of data

Lets assume the 2003 file server’s name is 2003FS, while the 2008 R2 file server’s name is 2008R2FS. And we are going to move two folders, named Sales and Marketing, on the D-drive of the old server to the D-Drive of the new server. Then the syntax for copying data would be as following (the command will obviously be ran at the destination server)

robocopy \\2003FS\d$\Sales D:\Sales /e /zb /copy:DATSOU /r:3 /w:3 /log:c:\robocopylog\sales.log /V /NP

robocopy \\2003FS\d$\Marketing D:\Marketing /e /zb /copy:DATSOU /r:3 /w:3 /log:c:\robocopylog\marketing.log /V /NP

The switches I am using here, are explained as such:

/E :: copy subdirectories, including Empty ones.
/ZB :: use restartable mode; if access denied use Backup mode.
/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
(copyflags : D=Data, A=Attributes, T=Timestamps).
(S=Security=NTFS ACLs, O=Owner info, U=aUditing info).

/R:n :: number of Retries on failed copies: default 1 million.
/W:n :: Wait time between retries: default is 30 seconds.

/LOG:file :: output status to LOG file (overwrite existing log).
/V :: produce Verbose output, showing skipped files.
/NP :: No Progress – don’t display percentage copied.

3. Copy data for the final time

robocopy \\2003FS\d$\Sales D:\Sales /e /zb /copy:DATSOU /mir /r:3 /w:3 /log:c:\robocopylog\FinalMirror\Sales.log /v /NP

robocopy \\2003FS\d$\Marketing D:\Marketing /e /zb /copy:DATSOU /mir /r:3 /w:3 /log:c:\robocopylog\FinalMirror\Sales.log /v /NP

I have included the /mir switch here

/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

In other words, /mir will do the same as /e and /purge

/PURGE :: delete dest files/dirs that no longer exist in source.

Keep in mind, it will only delete files/dirs at the destination, NOT at the source. Some people believe, for some strange reason, that files at the source are deleted as well. That is NOT the case.

4. Synchronizing NTFS permissions and other file related properties only

If you forget to include the /copy:DATSOU or /copyall option for whatever reason, and now are looking for a switch on how to synchronize the NTFS permissions, or other file related properties, then you can use the /secfix option

/SECFIX :: FIX file SECurity on all files, even skipped files.

When using the /SECFIX copy option, specify the type of security information you want to copy by also using one of these additional copy options: /COPYALL /COPY:O /COPY:S /COPY:U /SEC

The following example synchronizes file security information for the Sales folder we copied from the 2003FS server earlier

robocopy \\2003FS\D$\Sales D:\Sales /secfix /copy:SOU /r:3 /w:3 /log:c:\robocopylog\SecFix\Sales.log /V /NP

Remember this will only synchronize file security information between the source and the destination, it will not copy any files. To completely synchronize data and file security information, use the following command

robocopy \\2003FS\D$\Sales D:\Sales /e /zb /secfix /copy:DATSOU /mir /r:3 /w:3 /log:c:\robocopylog\FinalMirror\Sales.log /v /NP

5. The /MT option

/MT[:n] :: Do multi-threaded copies with n threads (default 8). n must be at least 1 and not greater than 128.
This option is incompatible with the /IPG and /EFSRAW options

Simply put, it will make the copy operation go faster, but use it with caution, if you define too many threads, you will saturate the network card of your server, or saturate the bandwidth of your network. Personally I rarely use this switch.

6. Caveat to copying in two phases

There is a small caveat to copying data in two phases. If someone changes only security information of a file/folder between phase 1 and phase 2, but not the content, that file/folder will be skipped during the copy process in phase 2, therefore the new NTFS permissions on the file will not be copied either.

The chances for someone to change only NTFS permissions on a file/folder between phase 1 and phase 2 might not be big, but they are certainly there. So if you know that might happen, you can use the /secfix option at phase 2 to copy NTFS permissions on files/folders, regardless of whether the file/folder has already been copied in phase 1 or not. The command you would use, is the final command in step 4 of this post.

Additional Resources:
Technet: Robocopy

Tags:

MicrosoftServer 2008R2Server 2012Windows Server
Author

Shabaz

Follow Me
Other Articles
Previous

Fine-Grained Password Policies in Windows Server 2008 R2

Next

Mapping Drives with Group Policy Preferences

6 Comments
  1. Bach Nguyen says:
    January 14, 2015 at 08:39

    I tested your guide. This just migrate NTFS permissions, how about Share permission?

    1. Shabaz says:
      January 17, 2015 at 11:31

      Hi Bach,

      The blog post only pertains to migration of data and NTFS permissions, as I have rarely if ever migrated shares in a production environment.

      Take a look at this KB from Microsoft on how to retain share names and permissions.
      http://support.microsoft.com/kb/125996

      Basically you need to do this;

      1. Export this registry key “HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares” on the old Server
      2. Import it on the new server
      3. Restart the new server

      Regards,
      Shabaz

  2. James says:
    March 11, 2016 at 15:53

    Where are you identifying the 2008 server in the syntex? i dont see a reference to it?

  3. Nithin says:
    April 17, 2016 at 13:04

    Hi Shabaz,
    Thanks. It worked well .

  4. Courtney says:
    August 13, 2016 at 06:17

    Precisely what I was looking for, regards foor posting.

  5. vikas khandola says:
    March 21, 2018 at 13:15

    use robocopy

Show Comments

Comments are closed.

Archives

Tags

Active Directory Citrix Failover Clustering Microsoft Powershell SCCM SCCM 2012R2 Server 2008R2 Server 2012 Server 2012R2 Server 2016 SQL Server Symantec VSF Test Labs Windows Clients Windows Server XenDesktop 7.6 LTSR Xendesktop 7.15 LTSR

Popular Posts

  • How to check if a machine is physical or virtual
  • Exporting multivalued attributes with Export-CSV cmdlet
  • Installing Remote Desktop License Server on Windows…
  • Configuring Remote Desktop Services Profile settings…
  • Installing Citrix XenApp and XenDesktop 7.15 LTSR
  • Enabling LDAPS with certificate from a 3rd party CA
  • Assigning ownership of files and folders with Takeown.exe
  • Retrieving User properties from Active Directory
  • SCCM 2012 R2 Client Installation
  • Citrix XenApp 6.5 Architectural Components
© 2014- 2026 — ShabazTech. All rights reserved.