Windows – How to copy huge (millions) directory trees in Windows

copyntfswindows

I have a NTFS partition that has a folder that holds over 5 million directories. Each directory contains more directories and then files.

I am moving to SSD and I need to copy all these data over to the new drive, but I am running into issues.

Directories like this will crash Windows Explorer, so I didn't even try it.

My first attempt is robocopy, which has worked well in the past. But when I tried to do the copy it just never started, even after leaving it for days. I think it was trying to index everything before starting the copy.

How do you copy directories of this size?

Best Answer

I have never seen robocopy fail like this, but if it is failing because of size/pre-indexing, then why not write your own script to do the copying? I would write the thing in PERL and just do the copy on a per-file basis and recursively go through it. You could add in checks in to see if the file already exists with the same time stamp, etc.

You could also check out RichCopy which is multi-threaded.