As you can tell this is no where near work related. I have an iMac G5 where my itunes is currently hosted, I have also just got a new MacBook Pro. What I want to be able to do is sync my itunes library from my iMac to my MacBook Pro, that way it can be accessible away from my home network, then if I make any changes to the itunes library (like change a track name) it will sync these changes back once I connect back to the home network.

My current itunes contains music, videos, podcasts, playlists and iPhone apps, I would also like iTunes to track play counts collectively between the iMac and the MacBook Pro.

4 Answers
4

This is pretty tricky, as there are several files containing iTunes metadata in addition to live running instances of iTunes. The trickiest of these to overcome is the fact that the running instance of iTunes does not write out data until it quits, so if you have running instances on both your iMac and MBP and you update the files underneath them, they will get lost. Further, paths are contained within the files, so this will not work unless you have identical paths on both machines (assuming you have not changed the defaults and have the same username, this would put the music in /Users/username/Music/iTunes/iTunes Music/ and the metadata in /Users/username/Music/iTunes/{iTunes Library,iTunes Music Library.xml}).

You can keep the music folder up to date on both by using rsync, but this only works cleanly if you either always add or delete items on one of the machines or if you only add items. If so, the two lines on the MBP would work:

You'll probably want to set up automatic authentication using public keys auth in SSH and put this in a cronjob.

To accomplish moving the metadata, I suggest you have a script running on both machines under cron which first determines if iTunces is running on the local machine and if it is not, it rsyncs the metadata files from the other server if the content on the other server is newer than that locally. Something like:

This still assumes that you don't make mods both instances with both instances being up continuously. Also, I have not tested this out, so there are probably some syntax errors or subtleties I'm missing.

This is how I keep both my iTunes and iPhoto libraries synced between 3 Macs. It seems to be pretty dang bulletproof. You'll probably want to use ‘-e ssh’ so that you don't have to have a rsync daemon running separately.
–
Scott PackJul 1 '09 at 1:15

I am using a tool called ChronoSync to do this right now, I just have my entire music folder (which also incudes the iTunes library metadata) synccing between the two computers. Works great for iPhoto as well.