"I have discovered the hard way that Apple's "Migration Assistant" doesn't always preserve file timestamps"
comment: It seems that has become Apple's MO - you must discover all things the hard way.
Caveats: I'm not entirely sure this will resolve your issue or answer your question, but I hope it will help. I don't actually know what Migration Assistant does because in 12 years and 5 different Macs, I have never used it. So this answer may be a partial answer, or it may be incompatible with Migration Assistant. As a guess, I'd say use rsync
after Migration Assistant - to clean up the mess it has left. Others here may have better ideas; the rest of my answer will be limited to rsync
.
The rsync
version I used was installed from MacPorts; version 3.2.4. I do not know if the rsync
version included with your version of macOS includes the required options or not - you may wish to investigate that instead of installing a current version of rsync
.
Background: I've begun using rsync
as my primary backup tool for macOS recently, and had to address some of the same issues as you: mangled and missing metadata. In my case the issue was caused by crossing a file system boundary - from APFS
on my local drive to btrfs
via SMB on a Synology NAS. In your case - Migration Assistant - I cannot even imagine how it could not even get the timestamp metadata correct, but you're certainly not the only one who's reported such issues.
I made some notes while working to resolve my issue, and they morphed into a procedure on my macOS GitHub repo. I'll try to keep this answer rather brief since most of the details are covered in that document:
rsync with metadata preservation
rsync
effectively copies data from a source (the "from" location) to a destination. If you are using a fileserver (NAS) as an intermediary between your two Macs, these commands may do what you need:
from "old Mac" to "NAS":
Assuming the source & destination folders are:
SOURCE: /Users/MyHome/MyData/
DESTINATION: /System/Volumes/Data/mnt/MyNAS/
From a terminal on your "old Mac":
% SRC-FLDR="/Users/MyHome/MyData/"
% DST-FLDR="/System/Volumes/Data/mnt/MyNAS/"
% rsync -rlAXtgoDivv --dry-run --fake-super $SRC-FLDR $DST-FLDR > rsync.log 2>&1
Explanation: This rsync
command uses the --dry-run
option, and therefore will not actually move or modify any files. It will give you a detailed log (the ivv
options) of what files would have been moved or modified. Once you are happy with the results, simply remove the --dry-run
option, and run again. Review the rsync.log
file using the "Decoding Table"
from NAS to "new Mac":
SOURCE: /System/Volumes/Data/mnt/MyNAS/
DESTINATION: /Users/MyNewMacHome/MyData/
From a terminal on your "new Mac":
% SRC-FLDR="/System/Volumes/Data/mnt/MyNAS/"
% DST-FLDR="/Users/MyNewMacHome/MyData/"
% rsync -rlAXtgoDivv --dry-run --fake-super $SRC-FLDR $DST-FLDR > rsync.log 2>&1
from "old Mac" to "new Mac"
If you can make an SSH connection between your "old Mac" & "new Mac", I see no reason to involve an intermediate NAS. The same rsync
options may be used; I'll leave it to you to formulate the SOURCE and DESTINATION folders.
Verifying Results:
In the GitHub recipe is included a short zsh
script that will stat
all of the files, folders, links, etc between the SOURCE and DESTINATION folders. It may be run following rsync
operations to verify that at least the stat
attributes are the same.