Hi,

I am going to move files from one file server to another file server. Thought I would use Robocopy with these parameters:

Robocopy \ server \ D $ \ SHARE01 E: \ SHARE01 / e / s / zb / copyall / r: 3 / w: 3 / log: c: \ ROBOCOPY-Logs \ SHARE01. log / V / NP

Are these parameters ok?

Is there a command that only copies changes or new files?

I plan to do this in 2 rounds. First I move everything and step 2 a few days later, copy changes or new files.

11 Spice ups

One issue with those parameters is any files or folders that are deleted in the source won’t be deleted in the destination on your second run. If you want to keep them in sync use MIR instead. Here’s an example of a script I use.

robocopy "\\servername\d$\foldername" "D:\foldername" /MIR /SEC /ZB /R:3 /W:3 /V /TEE /MT:16 /LOG+:"D:\robocopy_logs\foldername.log"
1 Spice up

Robocopy will only copy changed or new files.

I suggest adding /mir, which will DELETE extra files at the destination that are not at the source.

Be careful with /mir, as it deletes files. Make sure your source and destination are correct.

Have tested backups.

For a first run, I like to also use /create . It prevents directory fragmentation. You need to do a second and third run afterwards, as /create doesn’t actually copy files…just file name information.

1 Spice up

Forgot to mention, as Kevin has stated, my command will skip files on the second/subsequent runs if they already exist and have not changed between the source and destination. The source is always authoritative here.

1 Spice up

is a little scared to use / mir

So if run this command, will it not work?

Robocopy \ server \ D $ \ folder E: \ Bilder / e / zb / copy: DATSOU / r: 3 / w: 3 /log:c:\ROBOCOPY-Logs\folder.log / V / NP

Don’t be scared. Make a test folder and try it. You have nothing to lose.
I use MIR all the time personally.

1 Spice up

Can you please tell me what all the \ do? Like \sec

Open up a cmd prompt and type robocopy /?
You will see each one and an explanation of what each one does. If you have any questions beyond that(explanation unclear to you), let us know.

You can check/search each one individually like this for example so you don’t have to sift through all the help documentation at once.

robocopy /? | FINDSTR /c:"SEC"

robocopy /? | FINDSTR /c:"MIR"

1 Spice up

you should be able to do a robocopy /? and it will define what each param can do.

1 Spice up

Thanks I will check it out

/ SEC is there a copying option in the same way as / copyall?

/ mir it works so that if I copy the structure from srv1 to srv2 once.
3 files will be deleted from srv1. when you then run the same robocopy, they are deleted from srv2?

/ mir it works so that if I copy the structure from srv1 to srv2 once.

3 files will be deleted from srv1. when you then run the same robocopy, they are deleted from srv2?

Correct.

And if you are unsure if your syntax is correct, you can always make a “dry run” by adding the /L switch. Then you can spot any mistakes by looking in the log file. Correct them and when you are ready for the real copying/mirroring, just omit the /L.

1 Spice up

Yes and yes. However, /SEC doesn’t copy the current owner of files nor auditing info.

If you are migrating a file server, why not use Storage Migration Service https://www.starwindsoftware.com/blog/migrate-your-file-servers-with-storage-migration-service ? It is built into Windows Server 2019 and does everything automatically, including the final cutover. No second step is required.

1 Spice up