Migrating network Time Machine backups to a new machine

Migrating network Time Machine backups to a new machine

For quite some time now I use a Synology NAS as the central backup target for my devices. While this worked well, it is hard to expand. Having only four drive bays would require swapping disks for new larger capacity drives. Instead, I went the route to replace the NAS with a server built from left-over hardware. With 11 bays and room for more drive cages, this system won’t run out of space for years to come and additional disks can be added as needed.

The problem with this solution is: How to transfer old backups to the new server and keep on using them? It is trivial for the rsync backups of my server but a bit more complicated for macOS Time Machine backups.

Time Machine only works on HFS+ (macOS 10) or APFS (from macOS 11 on) formatted disks that a SMB network share cannot supply. Therefore, network backups get written to a sparsebundle image which in turn is formatted as required. This makes it easy to copy network backups, since sparsebundles are just directory and file structures. Backups on hard disks are written dircetly to the disk and therefore a bit more tricky to copy. The challenging part of moving network backups is to get Time Machine to recognize the migrated backup as the old one. The Time Machine Utility tmutil can do exactly that. Unfortunately, the documentation was not updated to reflect changes in newer versions of macOS (like macOS 11), such as the switch from HFS+ to APFS.

The following procedure worked for me.

Copy backup image to new location

Copy over the Time Machine image(s) from the old network share to the new share. In my case this means copying from old NAS to new server. rsync is probably the best tool for this task:

Options -avzihHX copy using archive mode (-a) with verbose (-v) output. Compressing data for transport (-z) speeds up the transfer a bit. Transfered files are listed (itemized, -i) with size in human-readable format (-h). To copy sparsebundles, preserving hard links (-H) should not be necessary but it likely doesn’t hurt either. Copying over extended file attributes (-X) should help Time Machine accept the backup.

Listing progress with --info=progress2 is a neat little upgrade over the regular --progress option.

The Synology NAS created a whole bunch of @eadir directories for indexing and reviews that I don’t need, nor want. So they are simply excluded from the transfer as are all other files/directories that do not end in .sparsebundle.

Get Time Machine to recognize the copied backup

With the backup image on the new server, the second step is to convince Time Machine to recognize and continue using it. I’m using a MacBook Air M1 (2020) on macOS 11.6 and the following might not work on other machines or versions.

In the Time Machine settings:

  1. Remove the old backup target on the NAS (“select volume…”, select the correct volume if more than one is present, “remove volume”)
  2. Add the new share on the server as backup target (“select volume…”, select the right share, “use volume”). If the new share does not show up in the Time Machine settings, it might be necessary to connect to the share once using Finder.

At this point, Time Machine knows the new backup target and should recognize that there is an existing backup. However, it will not continue to write an incremental backup to this backup but start a full backup instead. This is solved by associating and inheriting the copied backup image.

The backup sparsebundle image should have been mounted on the Mac while adding the new backup target. Here it is mounted to /Volumes/Backups\ von\ Nicos\ Air/. On my Mac, the user partition is called “Data” (seems to be the default in macOS 11) and has to be associated with the latest backup of “Data”:

The final step is to inherit the migrated backup:

Time Machine should now fully recognize the migrated backup and should continue writing quick, incremental backups. The first backup after the migration took longer than usual for me. Probably some re-indexing or comparing was needed. Opening Time Machine (the zoom-in effect on a Finder window) should show the full backup history with all dates before the migration.