Multiple Macs, One iTunes Library

The problem

50GB+ iTunes library.
Multiple Macs.
How can you share the iTunes library between Macs?

Solution #1: Home Sharing

The answer Apple provides is “Home Sharing,” which allows you to share the contents of your iTunes library with up to 5 Macs.

However, there are major shortcomings with Home Sharing. The first is the inability to edit the shared library. For example, if you want to edit a playlist, you have to use the Mac that controls the iTunes library. If you’re on a different machine and use Home Sharing to listen to your library, you will not be able to make any edits to the playlist (or add any new music).

A second major shortcoming is the inability to sync your iDevices (iPhone, iPad, etc.) using your other Macs. Apple wants you to keep your iDevice registered on a single Mac. If you sync your iPhone at home on your iMac, then take your iPhone and MacBook Pro with you on a trip, you won’t be able to sync your iPhone using your MacBook. Very annoying.

Solution #2: Dropbox

If your iTunes library is small enough, you can move your entire iTunes library onto the cloud. For example, a service like Dropbox will let you store up to 5GB online for free. If you use the Dropbox app on each of your Macs, Dropbox will copy all of your iTunes files to each computer, and will keep all of the items in sync for you automatically. If you add MP3s to iTunes using you MacBook, they’ll show up on your iMac shortly afterward.

There are two serious shortcomings to this system. The first is synchronization of the iTunes database file. You can run into synchronization problems if you edit the iTunes library on two Macs with a short period of time. Dropbox needs time to synchronize the files; if you edit the iTunes library on one machine, then edit the iTunes library on a second machine before Dropbox has synchronized the changes from the first machine, your iTunes database files will get out of sync and you’ll wind up losing some of your changes.

Let’s say you edit a playlist on your iMac, then import a CD using your MacBook. If the database file on the iMac isn’t synced before importing the CD on your MacBook, Dropbox will only sync the newest item. In this example, the imported CD would be retained but the edited playlist would be lost.

(It should be noted that this limitation applies to all cloud sync tools, not just Dropbox.)

The second drawback to syncing via Dropbox is the size constraints: Dropbox’s free account is limited to 5GB. As of this writing, their largest account is 50GB and requires a substantial monthly fee. My iTunes library is well over 80GB, so I’m out of luck.

Solution #3: Network Drive

If you have an Apple Time Capsule at home, you can use its file sharing features on your home network. (Attaching an external hard drive to an Airport Extreme provides the same functionality.) In theory, you can place your entire iTunes library on this network drive and let all your Macs connect to it.

Of course, nothing is ever that simple! When a Mac opens the iTunes library file, it becomes locked and no one else can use it. The other Macs will have to wait until the file is unlocked before they can connect to it. This means only one Mac can use iTunes at a time. Major drag.

Solution #4: Dropbox and Network Drive Hybrid

The Dropbox solution is certainly the nicest (and easiest) so far, but due to Dropbox’s account size limitations, it won’t work for me. However, since I have a Time Capsule with plenty of space, I’ve decided to combine the Dropbox and network drive approaches. Here’s how it works:

1. Move your entire iTunes folder to your home network drive.

2. Copy the iTunes library (database file, XML files) to your Dropbox folder (I placed them in a subfolder named iTunes).

3. Create an alias of the network drive’s iTunes Music folder and place it in your Dropbox folder. Be sure to rename it to iTunes Music (remove the word “alias”). Create an alias of the Album Artwork folder, too. If you skip this step, whenever you import music to your library, it will be copied to your Dropbox folder instead of your network drive. The aliases ensure iTunes places all new library items on the network drive.

4. On each Mac, configure iTunes to use the library file located in the Dropbox folder. Do this by holding option on your keyboard when clicking the iTunes icon in your dock. You will be prompted to choose an existing library or create a new one. Click “Choose Library” then navigate to your iTunes database file in your Dropbox folder.

That’s it! You can now access your iTunes library on each Mac without using Home Sharing. iTunes will behave identically on each Mac; you can add music, edit playlists, and sync your iDevices without Apple’s usual restrictions.

Caveats and Gotchas

I’ve been using this system for about a month with no major issues. Of course, no solution is perfect, and there are some gotchas to keep in mind with this setup:

  • Since Dropbox is handling the synchronization of the iTunes database file, only one Mac can edit the library at a time. Be sure to synchronize before using a second Mac to make updates.
  • If you update your iTunes software, you may need to recreate your aliases in the Dropbox folder.
  • You need to ensure you’re connected to your network drive before you start playing any files in iTunes, or else you’ll get the ‘missing file’ icon.

PDFObject Updated, Moved to GitHub

PDFObject is a JavaScript utility I created in 2008 to embed PDFs in HTML documents. It was modeled on SWFObject.

Three years have passed since PDFObject 1.0 was released, and the browser landscape has changed dramatically. I figured it’s time to dust off PDFObject and see if it can be improved and/or updated for today’s browsers.

I’ve placed a modified edition of PDFObject (version 1.1) on GitHub as an open-source project, allowing anyone to create a fork and make modifications. There are also a handful of example/test HTML files there, too. I could use some help testing the examples in different OS/browser combinations, and with different PDF plugins.

If you have suggestions for improvements, or have a few minutes to test PDFObject examples in your browser/OS of choice, I’d be grateful to hear from you. Just leave a comment below, or send me a message on twitter. So far I’ve only performed some cursory tests in Firefox 3.6 in OSX 10.6.6, but everything seems to work as expected.

I plan to update soon, too.