iTunes Library Syncing


Dear MacGeekery,

We have an iMac and two powerbooks in our family. We both use iTunes,
and have different music libraries on each. What is the best way to
sync multiple XML library files between multiple copies of iTunes?

Thanks,
whurley and dmcacosta




codepoet So, this is harder than it looks. You could do this in AppleScript, but it would take forever. I have two ideas for you, and you’ll hate them both. I was just lamenting today (really!) to JC that Apple needs to support this better, somehow. I don’t have a solution, but they’ve got some bright people. Anyway, here’re my ideas:

  • Stop using three computers. Move all the music to one of the computers and use iTunes Sharing to get it on the others. Add all new music to the main one and use the others for listening. This, obviously, does not work on the road and makes it so that you can’t add/edit from the clients. On those, you add locally and then, eventually, copy/add to the server and delete locally. At least then you know what you’re missing.
  • The XML file is not a live file. It’s an export saved when iTunes quits. As such, edits to it do not survive the next quit. However, you can import it. To import it cleanly you have to delete all playlists and tracks (do not delete files) and then import the file from File → Import. I say this because you can merge this list with another computer’s list (presuming you share the same path to music, like /Shared/Music) using FileMerge (in the Developer Tools).
    This is iffy. Each track stanza includes the path to the file, so you have to keep you music in the same place on every computer so that when you do this merge it only sees the changed items. Also, and this could suck, if it sees A, B, and C out of order on the other file as C, A, and B then it’ll want to change all of them, even though none have changed. It’s an inexact science, at best.
    At any rate, you just import the final file when done … and pray it works.

At this point in time I’m doing something different, though. I keep all my music on a share on a home server and mount it over AFP when I want to listen to music locally. If my spouse adds a track then I just re-add the share to iTunes (File → Add to Library) and it finds the new tracks. The only problem would be moved and renamed tracks that get added twice, leaving a ghost.

There doesn’t appear to be a clean solution to this, sadly.



ylon said

Yes, you’re right thanks. You couldn’t have a constantly sync’d xml. It would always be a “close behind.” I suppose it could be scripted so that a request is made by the other end to close iTunes in order to perform a sync…

I actually keep a couple of computers sync’d up here, but I do it occasionally, it’s not necessary for me to keep them constantly up-to-date. I wonder if there would be a way to “make” iTunes dump its xml rather than having to exit…

Adam Knight's picture

File → Export Library will do it, but the resulting file does not have the track ID keys nor the normalization (Sound Check) keys, so it’s lossy.

What’s needed is a program that will take the XML files, parse them, find new/changed data, merge it, and then write out a new one, possibly telling iTunes to delete everything and import it.

Complicated and dangerous work that I want no part of. Smiling

cp

ylon said

Heh, sounds fun if I had some time and a real need… Smiling

ylon said

It would seem that rsync would work alright with such an application. It would take writing a script to do this automatically for you before iTunes startup or just sync it up each time you desire to have your libs sync’d. I think that with a lot more development of this you would have a workable solution.

Adam Knight's picture

The problem is that two people can have it open at the same time, both make changes they want to keep, and then whoever quits last wins. File sync is inelegant and destructive in the case of multiple changes.

cp

Syndicate content