windows2003 to windows2012

Have a windows2003 server and want to migrate everything from w2K3 to windows 2012.
It is just a file server, but users are keep changing the files, have to have minimum down time.
Does robocopy synch the files if there is any change on the source?
Appreciate your recomendations.
LVL 2
sara2000Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zalazarCommented:
robocopy syncs the files indeed when there is a change on the source
By using the /MIR (mirror) option the source and destination will be exactly the same.
It will also make sure that files that are deleted on the source are also deleted on the destination.

For perfomance reasons it's always best to run the copy command on the destination server.
In this case the Windows 2012 server.

Please note that the robocopy versions that come with the Windows 2012 OS can have problems with copying NTFS permissions. This is a bug.  To overcome this you could use the older XP010 version which is included in the Windows 2003 resource kit.

If you haven't installed the resource kit then you can download the Windows Server 2003 Resource Kit Tools via this link:
https://www.microsoft.com/en-us/download/details.aspx?id=17657
You do not have to install the software, just unpacking the files.
Unpack rktools.exe with e.g. 7-Zip
Unpack rktools.msi and copy "robocopy.exe" to the directory where you want to run the script.
Rename robocopy.exe to robocopy010.exe

For the copy commands:
If you use UNC paths for Source and for Destination then make sure you have full control on the share permissions.
Also make sure that you have full control on the NTFS permissions.

As an example:
Source is: \\server1\e$\Data\Groups
Destination is: \\server2\e$\Data\Groups

Be careful when choosing your source and destination.
Making a mistake can be very costly.

Procedure:
To minimize directory fragmentation, first do a copy with the /CREATE option.
This will only copy the directory structure including all the files as 0 bytes files
It will also copy the NTFS permissions, (S in DATSO) and File Ownership information (O in DATSO).

robocopy010.exe "\\server\e$\Data\Groups" "\\server2\e$\Data\Groups" /CREATE /E /DCOPY:T /NP /R:0 /W:1 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log

Open in new window


Then execute a second command to copy the Data.
robocopy.exe "\\server\e$\Data\Groups" "\\server2\e$\Data\Groups" /MIR /DCOPY:T /NP /R:0 /W:1 /COPY:DATSO /MT:8 /LOG+:C:\Temp\robo_log2.log

Open in new window


This will also copy directory timestamp (/DCOPY:T)
With the /MT:8 option robocopy will use multiple threads which will improve the performance
The mirror option will make sure that the destination will be exactly the same as the source.

To save time, all above can be done as a sort of pre-copy.
On final migration day just execute the last command again:

/MIR  The mirror option will make sure that the destination will be exactly the same as the source.
/NP   Turns off the copy progress indicator
/R:0  No retries. By default robocopy will do 1000000 times a retry when a copy fails (e.g. due to an open file or a permission problem) and it waits 30 seconds between the retries.
sara2000Author Commented:
Thank you for your quick response.
My case my e: drive has several folders (data1, data2, etc)
Can I use ?
robocopy010.exe "\\server\e$\*.* " "\\server2\e$\*.* " /CREATE /E /DCOPY:T /NP /R:0 /W:1 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log
zalazarCommented:
Yes that is no problem but you have the exclude copying the Recycle Bin (RECYCLER on Windows 2003 and $Recycle.Bin on Windows 2012) and System Volume Information then.
Please also remove the *.* as robocopy expects "source "destination" "files to copy"
For the "files to copy" *.* is the default.

robocopy010.exe "\\server\e$" "\\server2\e$" /CREATE /E /NP /R:0 /W:1 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log /XD "\\server\e$\RECYCLER" "\\server\e$\System Volume Information" "$Recycle.Bin"

Open in new window

I just realized that the robocopy010 version does not yet support the /DCOPY:T option, so you have to remove this option there.
You can leave it in with the othe robocopy command.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
The newer Robocopy (from W2008) knows of /DCOPY:T, and can be used without issues. Also /COPYALL is the same as /COPY:DATSO - which one you want to use is a matter of taste.

/R:0 is ok for the intermediate runs, but the final run should be more persistent with trying to copy data - I recommend /R:5 /W:5 for 5 retries, pausing for 5 seconds, per file. And to check the log for errors, of course.
I cannot see any use for the LOG+, as the only interesting log is the last one, we do not need to append to prior attempts.
Using /MT:8 is arguable. I would NOT do that with the intermediate copies, as you most likely do not want to max out used network bandwidth  instead it should run using least resources possible if done while the systems are in use.
zalazarCommented:
Hello Qlemo, thanks for your good comment.
I have seen many environments where the default OS robocopy (from 2008 R2 or in this case 2012) does not copy NTFS security.
You can of course first give it a try with the default OS robocopy on a small set of data.

/COPYALL is actually /COPY:DATSOU
U = for copying auditing information
But as auditing is most of the time not configured you could say that it's more or less the same.

For the /R:0, it probably comes down of how you like to work.
You should always check the logfile for "Access Denied" messages or other problems and in case of a copy problem and using /R:0, the errormessage will also be there.
sara2000Author Commented:
Hope you do not mind to correct , i never used THIS ROBOCOP .
Decided to go for windows2012 instead of windows 2008. So first I have to apply
robocopy010.exe "\\server\e$" "\\server2\e$" /CREATE /E /NP /R:0 /W:1 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log /XD "\\server\e$\RECYCLER" "\\server\e$\System Volume Information" "$Recycle.Bin"
Then i have to execute once the above finish.
robocopy.exe "\\server\e$" "\\server2\e$ " /MIR  /NP /R:0 /W:1 /COPY:DATSO /MT:8 /LOG+:C:\Temp\robo_log2.log
zalazarCommented:
Sure. The first command is ok.
With the second command you can leave in /DCOPY:T and also add the exclusions.
In total it will be:

1st command to create structure with 0 files and copy NTFS security and file ownership:
robocopy010.exe "\\server\e$" "\\server2\e$" /CREATE /E /NP /R:0 /W:1 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log /XD "\\server\e$\RECYCLER" "\\server\e$\System Volume Information" "$Recycle.Bin"

Open in new window


2nd command to copy all data including directory timestamps
robocopy.exe "\\server\e$" "\\server2\e$" /MIR /DCOPY:T /NP /R:0 /W:1 /COPY:DATSO /MT:8 /LOG+:C:\Temp\robo_log2.log /XD "\\server\e$\RECYCLER" "\\server\e$\System Volume Information" "$Recycle.Bin"

Open in new window


You can repeat the second command as many times as you like and for the last time at the migration.

After the copy check the logfile for "Access Denied" or other error messages.

You can also open a File Explorer, select all directories on the E-drive and get the properties.
If you would do this on server and server2 you can compare the amount of files and folders, and total Size in bytes.

Directory structures including filenames that are more then 256 characters long can not be accessed by the File Explorer but will still be copied by robocopy.
sara2000Author Commented:
Sorry for the lack of knowledge, downloaded windows2003 robocopy and renamed it to robocopy010.exe and I ran the above  command on the target server, it did not run. Lookalike I am missing something.
I believe I have to put " " where you listed , am i correct?
zalazarCommented:
No problem at all. Can you tell what the exact message was.
And which comma "," character do you mean exactly ?

If you are logged on to the Windows 2012 server.
Then e.g. copy the renamed robocopy010.exe to a directory e.g. C:\Temp
Then start a Command Prompt (cmd.exe) with Administrative permissions (use Run as administrator).
Type the command:
cd /d c:\temp
Type:  robocopy010.exe
This will actually not do anything else then show some help but it does make sure that robocopy010 works fine.
The syntax is robocopy010.exe "source" "destination" <parameters>
Where "source" and "destination" are directories.
So in my example "server" should be the Windows 2003 server and "server2" the Windows 2012 server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sara2000Author Commented:
I managed to run the command, the source disk about 135GB, but it took more than 300GB at the destination.
Is that normal ?
zalazarCommented:
Normally the size of the source and destination should be equal.
It might be that you have some directory junctions within the directory structure you are copying.
These are links to another directory and probably outside the structure you are copying.
You can skip the copying of these directories by adding an extra parameter:  /XJ for the robocopy010 version or /XJD for the newer robocopy
The second command will be then:
robocopy.exe "\\server\e$" "\\server2\e$" /MIR /DCOPY:T /NP /R:0 /W:1 /COPY:DATSO /MT:8 /LOG+:C:\Temp\robo_log2.log /XJD /XD "\\server\e$\RECYCLER" "\\server\e$\System Volume Information" "$Recycle.Bin"

Open in new window

Maybe you can first try to find out if there are indeed junctions and where they are pointing to.
sara2000Author Commented:
It is working for me now, one more question, can i run the step two in a new command prompt? Chances the server get rebooted, or command prompt was closed out etc.
I ran first and all copied,day later I want to run the second command again to make sure the change on the source server is copied .
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
You can use the exact same command as often as you like, in as much cmd windows as you like, even simultanously (though that doesn't make much sense).
zalazarCommented:
Good to hear that it's working.

As already mentioned by Qlemo, thanks Qlemo.
You can run step two in a new command prompt without any problem.
You can run the second command as many times as you like.
sara2000Author Commented:
This server has another disk , some reason ,L$ share has been disabled, not sure why.
I ran same command and was not able to mirror completely, lot of files were skipped. Seems to me that the administrator do not have enough permission to that disk. I logged in to both servers as admin, but do not want to give too much permissions.
Is there any other options which i have to included to copy it ?
sara2000Author Commented:
It worked after fixing the NTFS permission . Thank you for the help.
zalazarCommented:
You're welcome and good to hear that you got it working by changing the NTFS permissions.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.