Move files, overwrite if identical

I have 16 4TB hard drives that was once backups of my primary data drive. I want to move the contents off from it doing a move, overwrite if identical else rename if not the same.

Does anyone have any suggestions? I'd rather not use ignore if the same because that leaves files behind. I will lose track of where I am at because this will take a few months. I don't trust my memory to know the files are retained.

Thanks in advance!


Assuming "identical" means the same path/name/size/date (but not a full contents check), it's usually very quick to skip all the identical files if everything else has already been moved. So you can often do one final run of the whole drive to make sure nothing has been missed at the end, without it taking long. Then delete the source files that are still there if desired.

That has been my approach, at least.

1 Like

Hi Leo,
That's the technique I use for a directory or two where I don't lose track of where I was at. But with so many folders spanning 16 drives I caught myself repeatedly moving the same folders again and again. I've wasted a lot of time that I could be doing other things.
Perhaps this is a question that I need to ask in a PowerShell forum?

If you think one drive is probably done, but aren't completely sure, do the whole thing again to make sure (which should be fast if there's nothing left to do on that drive, as no data will actually get copied), then delete the remaining files and move to the next drive.

The only thing that would usually take along time is copying the actual data. (At least unless it's a drive with millions of very tiny files, where reading the directories takes a long time. That's rare, but I have seen it and it can be a pain.)

You could also use labels to mark the folders as you start them copying/moving, so you know which can be deleted once each operation completes.

That's an idea I never heard. I'll try it.

Thank you!