How to solve permission issue during the Finder copy of Time Machine backups? Or find another way to copy Time Machine backups...
I followed the instructions in the KB article about how to copy a Time Machine backup to a new drive (https://support.apple.com/en-us/HT202380). Both disks are formatted with APFS (Case-sensitive, Journaled). But after about 160GB (out of ~450GB) the copy fails with the error message "The operation can't be completed because you don't have permission to access some of the items".
I tried it multiple times, always starting from scratch. Every time it seem's to stop at the same point. The copy is done while being logged in as administrator. The author of this question describes the same issue: https://discussions.apple.com/thread/8328053
Since I couldn't get it working with the approach suggested by Apple I tried a few more things to copy my Time Machine backup to a new disk. Before turning to the command line approaches I made sure that Terminal has been granted Full Disk Access.
Restore with Disk Utility
Fails with
Source volume format on device "/dev/disk2s2" is not valid for restoring
Could not validate source - Operation not permitted
To be honest I didn't expect too much from this idea as the disks don't have the same size. Both are formatted with APFS though.
rsync (1)
$ sudo rsync -avHAX /Volumes/Source/Backups.backupdb /Volumes/Destination/
Fails because the preserved ACLs prevent rsync to copy files into the directories.
pax
$ cd /Volumes/Source && sudo pax -rw ./Backups.backupdb /Volumes/Destination/
Same permission issue as with rsync (1).
pax: Could not create: /Volumes/Time Machine/./Backups.backupdb/Moriarty/2017-12-08-223346 <Operation not permitted>
rsync (2)
$ sudo rsync -avHX /Volumes/Source/Backups.backupdb /Volumes/Destination/
Might actually work but is super slow. For small files it takes about 10 seconds per file. After 3 hours I gave up when it had copied not more than 9MB. The idea was to restore the ACLs after all files had been copied.
find + tar
$ cd /Volumes/Source && sudo find -d Backups.backupdb -print > ~/TMFileList
$ sudo tar -cf - -T /Users/Administrator/TMFileList | sudo tar -xpvSf - -C /Volumes/Time\ Machine/
Same issue as with rsync (2). Way to slow to be useful at all.
The problem with rsync (2) and find + tar seems to be that there are long periods of inactivity between file transfers. In those period no disk IO is ongoing and neither is there any significant CPU load. This issue is also reported by this guy: https://apple.stackexchange.com/a/323691. I have no good idea of what could be the issue in this case.
Any additional suggestions or ideas about how to copy TM backups from one disk to another are very welcome.
MacBook Air 13", macOS 10.14