Mac – How to move time-machine backups to a new external disk

external-disktime-machine

My 4TB external hard drive has 2x2TB volumes. I use one of these for time-machine backups. I have ~6 months of backups on here. The drive is beginning to die so I want to transfer the data from each of the 2 volumes on the old drive to volumes on the new drive.

I was able to use rsync to move the data on the non-time-machine volume no problem.

 ?>rsync -avz /Volumes/data/dir1/ /Volumes/data2/dir1/

However, it gave me errors when I tried to use it on the time-machine volume:

 ?>rsync -avz /Volumes/time-machine/Backups.backupdb/ /Volumes/time-machine2/Backups.backupdb/
sending incremental file list
rsync: opendir "/Volumes/time-machine/Backups.backupdb/." failed: Operation not permitted (1)

sent 53 bytes  received 12 bytes  130.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1209) [sender=3.1.3]

I tried following apple's official instructions but finder got stuck "Preparing to copy" my 2 TB of data for hours. One frustrated user asked if there was a way to continue the finder copy that had been running for 5 days before failing.

P.S. I'm not sure why finder takes days to move data that rsync can move in hours?

enter image description here

It seems like rsync would be the right tool for this job. Perhaps using sudo? No luck:

 ?>sudo rsync -avz /Volumes/time-machine/Backups.backupdb/ /Volumes/time-machine2/Backups.backupdb/
Password:
sending incremental file list
rsync: opendir "/Volumes/time-machine/Backups.backupdb/." failed: Operation not permitted (1)

sent 55 bytes  received 12 bytes  134.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1209) [sender=3.1.3]

I found a suggestion on another post to actually run rsync as root. I enabled the root user, and tried running as root, but I still got errors.

b:~ root# rsync --version
rsync  version 3.1.3  protocol version 31

b:~ root# rsync -avz /Volumes/time-machine/Backups.backupdb/ /Volumes/time-machine2/Backups.backupdb/
sending incremental file list
rsync: opendir "/Volumes/time-machine/Backups.backupdb/." failed: Operation not permitted (1)
./

sent 62 bytes  received 19 bytes  162.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1209) [sender=3.1.3]
b:~ root# 

It seems to be unusually complicated to so something that should be very simple. What am I missing?

Best Answer

It seems you're not using the standard rsync program that comes with macOS, but rather a different version from for example HomeBrew. In that case you'll probably want to use the --acls option to ensure that proper ACLs are being used.

The "operation not permitted" even as root seems to indicate that you're running Catalina, and haven't given the program the necessary permissions. In Catalina there's a seperate security layer that protects the user from malicious programs - even those running as root. You'll want to open System Preferences => Security & Privacy and give "Files and Folders" permissions and/or "Full Disk Access" permissions to the Terminal.app and rsync programs.