Migrate External Time Machine to OS X Server (part 2)

If you're curious and wondered whether its possible to migrate an external disk Time Machine backup to OS X Server or even a Time Capsule, the answer is: Yes, its very possible! In comparison to part 1 where we migrated Time Capsule backups to OS X Server, we had the luxury of simply moving a sparsebundle disk image. External Time Machine backups do not use sparsebundles, thus we need to create one first.

First, verify the size of the external backup, a simple Finder 'get info' on the external volume will do just fine. We need this to determine the size that will be specified for the disk image we are about to create. E.g., lets say our external backup has a size of 100GB for the data, then just add an additional ±20GB giving us a final figure of 120GB. The reason for adding 20GB to the equation is that when we create the disk image, it needs to create a file system etc which also take up space. Specifying just 100GB will result in an error of not enough disk space available. Mind you 20GB extra is probably overkill but it doesn't really matter as it won't actually make an image thats 120GB in size, think of it as an initial 'soft limit' of sorts.

Again, it's advisable to disable Time Machine in System Preferences on the client. Lets fire up Terminal.app...

Creating the disk image we'll do the following:

hdiutil create -size 120GB -type SPARSEBUNDLE -fs JHFS+ ~/Desktop/tmbackup.sparsebundle

Mount the newly created image.

hdiutil mount ~/Desktop/tmbackup.sparsebundle

At this point we need to gather our source and target volume identifiers. Make a note of the external Time Machine volume eg. disk0s4, also our target disk image we created (the previous step already shows us this for the sparsebundle) eg. disk1s2.

diskutil list

Unmount the external Time Machine volume

diskutil umount disk0s4

Next using ASR (Apple System Restore), we will transfer the data from the external Time Machine volume to our new Sparsebundle image.

sudo asr --source /dev/disk0s4 --target /dev/disk1s2 --erase

Once completed, eject the mounted sparsebundle.

diskutil eject disk1

Now that we have a sparsebundle, we can follow the same procedure as in Part 1, there is however one additional step to be aware of. Our newly created sparsebundle containing the external drive backup must be associated with the client machine in its new form. Here's how:

Complete the steps in Part 1 (short recap below).

  • Copy sparsebundle to OS X Server
  • Change owner and permissions accordingly
  • On client set new Time Machine location to OS X Server

IMPORTANT: Turn Time Machine off immediately after selecting your OS X Server, we don't want the client to do an automatic backup just yet!

On the client machine, make sure the OS X Server Time Machine share is mounted in Finder. Run the following command.

sudo tmutil inheritbackup /Volumes/Backups/tmbackup.sparsebundle

Now you can switch on Time Machine in System Preferences and test the backup! Be sure to initiate a backup as it will trigger Time Machine to also verify the new backup location and sparsebundle. If all went according to plan you have successfully migrated an external Time Machine backup to an OS X Server running the Time Machine service.