Is There a Way to Keep Folder Creation Times When Using AzCopy?
Asked by
!faultDip35
I'm currently trying to transfer a bunch of files and folders from one Azure file share to another using AzCopy. I'm running the command: `./azcopy copy 'https://mystorageaccount.file.core.windows.net/files1/*' 'https://mystorageaccount.file.core.windows.net/files2' --recursive --preserve-info=true --preserve-permissions=true` which does a great job of preserving the last modified time for files, but it seems to neglect the creation time for folders. Is there a way to retain those folder creation times with AzCopy? Also, if I were to use Robocopy, would that mean I need to download and re-upload all the files? What's the best approach to transfer a large set of files while keeping as much metadata intact as possible?
Answers
Have you tried using `--preserve-smb-info`? That might help with your issue since itโs supposed to handle and preserve more metadata. Just make sure you're on the latest version of AzCopy as sometimes features can change.
Reply to this answer
Another approach could be to run AzCopy first to copy everything over, and then follow it up with Robocopy using the `/e /timfix /dcopy:t` options to fix the timestamps afterwards. It might be a bit of a workaround, but it could save you some hassle in the long run.
!faultDip35: That sounds like a good strategy! I think Iโll try that method, thanks for the tip!
Reply to this answer
I've definitely faced similar struggles when moving large batches of files. In my case, I had to deal with virtual data rooms, and preserving the folder structure was a real headache. I even created a tool called EZFolders to help manage consistent structures. Itโs a different situation than AzCopy, but Iโd love to know if anyone has found a reliable way to keep folder creation times intact while using AzCopy versus just relying on Robocopy, which, as you mentioned, has some overhead with downloads.
Reply to this answer
Unfortunately, AzCopy does have some limitations when it comes to preserving metadata, especially for Azure Files, since it relies on the FileREST API. If you're looking for a more reliable sync method, Robocopy with data plane access would be a solid choice.
Reply to this answer
Add your answer
Answers are reviewed before publication.
!faultDip35: That sounds like it could be useful! But I've read that itโs similar to `--preserve-info`, right? Iโm not sure if itโll solve my folder creation time conundrum.