Quickest one-way copy/sync

I need to replace some of the files in one drive with those from another.

There are thousands of files, in hundreds of folders. Many, but not all of the ones being replaced are out of date. Some files in the receiving folders have no equivalent in the source folders, and I want to delete those. I could delete everything from the receiving folders, and just coipy in the source folders. I could use the Opus sync tool, I think.

The drives in question are USB-connected WD MyBook drives, the source connected to my PC, and the receiving drive connected to my router. Whichever way I go, it is going to take some considerable time (hours). Just deleting a batch of folders takes some considerable time. Formatting the receiving drive is not an option as it contains some unrelated files I want to keep.

So, is any option going to be significantly faster than any other?

If most of the files are going to end up being re-copied anyway, then you might as well delete the destination folders and copy everything. Even if it takes slightly longer to copy the data (because a few files are copied which were already up to date), it keeps things simple and is more likely run to completion without needing to prompt you, while you do other things.

If most of the files don't need copying then that may change things. Although waiting for forum replies is probably the bottleneck in your strategy here, unless you can save more than 5 hours of file copying time. :slight_smile:

A sensible analysis, Leo.

Thank you.

Is this what you're looking for?

I use robocopy to do a one-way copy/sync as you call it.
It updates the destination to be equal to the source without copying what does not need to be copied.

[code]//ms-dos type to make modifier @leavedoswindowopen work
@leavedoswindowopen
@nofilenamequoting

Confirm MSG="Synchronize (mirror to destination) with Robocopy?\n\n{sourcepath$|noterm}\nto\n{destpath$|noterm}" TITLE=RoboSync
Robocopy.exe "{sourcepath$|noterm}" "{destpath$|noterm}" /V /E /NP /R:1 /W:1 /COPYALL /PURGE[/code]

Thanks for the reminder, @tbone.

I once made regular use of RoboForm, but had quite overlooked it on this occasion. You are right, it would have been a good choice. I had tens of thousands of files in hundreds of folders, comprising about a terabyte of storage to process. There were many files to discard completely from the receiving drive, many were exact duplicates, and many more which were out of date, and needed to be replaced by fresh ones from the source.

I have no idea which process would have been faster. I'd probably have spent an hour or so re-reading my RoboForm manual, before I could get started. :smiley:

Nonetheless, I followed Leo's advice, which was my initial inclination anyway. A very straightforward process, and after some hours, the job is done. Just deleting the receiving folders/files took some hours, before I could start copying the source.

Ultimately, of course, Leo was right.

I asked the question on 27 Dec at 16:21 (all dates/times local to me).

He replied on 27 Dec at 21:12.

I read and replied on 28 Dec at 11:24, and got under way.

@tbone offered his solution on 29 Dec at 05:14, and had I thought of it, I definitely would have used RoboForm.

However, by the time I read it on 29 Dec at 15:05, the job was complete. :smiley:

PS: Of course, I meant RoboCopy.

Well, there's always the next time! o)

Deleting everything before copying back, increases the risk to loose the data you have, just imagine your primary source to suddenly fail.
Don't know if this applies to your scenario of course, but I bet my right arm, using robocopy would have been a lot faster! o)

@tbone -- when I run your code I get: ERROR : No Destination Directory Specified

You use DO v9?

I use DO v11.

Did you set the button to be of type "MSDOS"?

Yes MSDOS-Batch Function

You'll need the "Confirm" script add-in as well, since Confirm is not a built-in command.

I think this Help & Support thread is the only place to get it at the moment: Confirm Dialog Variables Modifiers Arguments

Try to remove the line starting with "Confirm.. " or add "//" in front of it to disable it (without the quotes).
If that does not cure the problem, please make a screenshot of the error message so we know where it comes from.

PrePost-Edit because of Leos answers:
Yes, in alternative to removing the "Confirm.. " line, installing the addin can help as well.

Thanks guys.

Does it work now?

I tried to get the same result as you, but could not reproduce, even with a single lister window. In this case a requester comes up, asking for a proper destination, so I'm quite clueless. Consider posting the screenshot and maybe also give an example of what kind of paths your working with (UNC/FTP/Collection/Library etc.), maybe it is related to that.

@tbone--here goes--screen shot.


Try this (which doesn't show the confirmation dialog, but that won't work without the add-in anyway):

[code]//ms-dos type to make modifier @leavedoswindowopen work
@leavedoswindowopen

Robocopy.exe {sourcepath$|noterm} {destpath$|noterm} /V /E /NP /R:1 /W:1 /COPYALL /PURGE[/code]

The main change is to let Opus handling quoting of the paths, which will fix the problem of sending "K:" as an argument to a DOS command, which will think the " is a literal " character, because MS-DOS has really crazy rules about parsing command line arguments and quotes.