100% reliable directory copy on Windows systems (NTFS)
Is there a directory copying method for NTFS that can copy a directory 100% accurately, every time, with every single file, sub-directory, permission, attribute, and symbolic link / junction intact without skipping a single file? I'm open to any suggestions, including command line, boot disc tools, partial disc imaging (as long as you can restore to a disc with data on it and not wipe it), raw copying, or anything else that might solve this.
I run into this problem far too often. I need to copy a tree of directories to another location but am foiled every time by some file that refuses to copy for one reason or another (access denied, file in use, or the best one, no reason given, it just refuses to copy.) Many methods don't copy NTFS permissions. Along with that, all the file copying tools are woefully inadequate when it comes to symbolic links and junctions. I want to copy the symbolic link itself, not the contents of the referenced location.
Copying certain directories in Windows is almost always a recipe for failure. Even tools like FreeFileSync that use shadow copying fail. Because of that, I prefer command line or boot disc solutions. (I boot to command line using Windows install disc.) Acronis True Image file backup/restore doesn't copy symbolic links or junctions and seems to skip several files as well (and runs incredibly slow from the boot CD.) Even Xcopy and Robocopy fail to copy 100% of the files, and neither can copy junctions, hardlinks, or directory symbolic links.
For example, I am currently trying to copy a Windows 8 system's C:\Users and C:\ProgramData to drive D. Regardless of the options used, booting to the command line, Robocopy still fails to copy several files, just skipping them without any reason given. Xcopy doesn't seem to get them all either. And because Windows uses a number of directory junctions in these folders, you're forced to rebuild them manually one by one.
Solution 1:
I know this question is old, but I think there is a new answer that might be helpful since this question has not been answered with any upvotes, and I've never gotten a good answer to similar questions.
I just found FastCopy for Windows available free under GPLv3. https://en.wikipedia.org/wiki/FastCopy
FastCopy is still maintained by Shirouzu Hiroaki (@shirouzu) and was last updated on August 8, 2018 (as of this answer). It supports:
- copying path names well over the 260 character limit
- avoiding OS cache (by default) to improve speed
- can copy ACL with Extended Attributes and alternate streams
- will optionally copy HardLinks, Junctions, and SymLinks
- copy verify via various hashes
- differential copying based on size/date, etc.
The download is linked from his website (with source code available) here.
It is an EXE installer (ugh) but during install allows a portable "Extract Only" installation to the directory of your choice.
I was amazed by the speed today and it will save me hours on a repeated copy task that I have implemented. I have tried other frequently referenced alternatives like Robocopy, TeraCopy, xxcopy, Ultracopier, Copy Handler, etc., but I've never seen anything perform like this.
Solution 2:
Robocopy might be able to copy those after all:
http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx
/sl Copies the symbolic link instead of the target.
Solution 3:
I've used Macrium Reflect (free) and had no issues. Requires to boot from a CD, so that everything is gotten if you are wanting to do a full system backup/restore if you move to a new HDD/SSD. Very easy to use. https://www.macrium.com/reflectfree