Sunday, August 10, 2008

How to transfer local Time Machine backups to Time Capsule

I was able to successfully transfer the backups from our 500GB external FireWire drive to our new 1TB Time Capsule. This was not easy, so I decided to document the process for anyone who is interested.

1) Connect the external hard disk and the Time Capsule (via gigabit Ethernet) to the same computer.

2) Complete a backup to the hard disk, then turn off Time Machine while doing the conversion.

2a) If you have other computers backing up to the same hard disk, make sure those have a current backup as well before continuing.

3) Unmount the external hard disk.

4) In Disk Utility, create a new disk image from device from the external hard disk. Select the partition rather than the whole disk. I saved the image directly to the Time Capsule. This will take a long time. In my case, it took over 12 hours.

5) Unplug the external hard disk.

6) At this point, you have a .dmg with the complete contents of the external hard disk. This needs to be converted to a .sparsebundle image. This can be done using "hdiutil convert -format UDSB harddisk.dmg" on the command line. The sparse bundle will be smaller than the .dmg since free space is not copied into the sparse bundle image. In my case, I had enough space on the Time Capsule to fit both images at the same time.

6a) After the conversion was completed, I removed the .dmg file, and made another copy of the .sparsebundle. This is because I was backing up both my MacBook and Kathy's MacBook to the same external drive. In a single computer case this is not needed.

6b) Next, the two images need to be fixed up to only contain the relevant files and free space on the Time Capsule. I mounted each image and deleted the inappropriate set of backup files. This seemed to work best dragging the top level folder under Backups.backupdb to the trash and then doing rm -rf in Terminal on the files. Emptying the trash might work as well but seems to be slower.

6c) After removing unneeded files, to free up space on the Time Capsule, unmount the disk image. Then run "hdiutil compact image.sparsebundle" in Terminal. This will remove unused band files from the sparse bundle.

7) Configure Time Machine to use the Time Capsule and start a backup. Once a disk image is created, stop the backup. The image should be named <computer>__<uuid>.sparsebundle. Remove this image and rename the sparsebundle you created to match the name. Then do a backup again. You should still be doing this over Ethernet.

8) After the first backup, wireless backups should be fine.

The only other consideration is that the image size may not be correct (500GB vs. 1TB), but I don't suspect to run into that limit any time soon, and it is easy enough to resize using hdiutil.

Wednesday, August 06, 2008

Time Capsule arrived

We finally took the plunge and got a 1TB Time Capsule to replace our current 500GB Maxtor hard disk which has been backing up Kathy's and my MacBook since we upgraded to Leopard (around the time of my last blog post actually - yes I am lame for not blogging for so long).

So far I am liking the Time Capsule. Right now I have it set up in bridge mode and am still using the LinkSys WRT54G as the main router. Here are some of the tradeoffs between the two routers:

* Time Capsule has a built in hard disk which can be used for wireless backup
* Time Capsule supports USB printer sharing (thinking of moving the inkjet printer to be shared this way - it's currently shared by the Mac mini)
* LinkSys supports dynamic DNS which I am currently using... Time Capsule supports Back to My Mac, but doesn't seem to support dynamic DNS
* LinkSys has 4 100Mbit ports plus 1 uplink port, Time Capsule has 3 Gigabit ports and 1 uplink port
* LinkSys is 802.11g, Time Capsule is 802.11n
* Time Capsule requires a reboot for any configuration change, which takes 30 seconds or something. Config changes on the LinkSys happen much faster.

Overall, I think I should be able to totally replace the LinkSys with the Time Capsule, but the first challenge is to transfer our last 9 months of backups over to the Time Capsule. This is not as simple as you might think because the Time Capsule needs backups in sparsebundle disk image format, and the backups we have are just stored as files on the hard disk directly. I have an idea for how to get this working which is taking a while. If my plan works I will post an update on how to do it for anyone who's interested.