Transferring a Music Library to a Secondary Computer

Monday, 2004-09-20; 00:34:00

Just a note to let you know of a potential problem if you want your music library on more than one computer

My main computer is a 17" 800 MHz G4 iMac (man is that new G5 iMac tempting, but I definitely don't need it). I do have a 667 MHz G4 Titanium laptop, though, which I inherited from my dad since he dropped it and cracked the case. He ended up buying a newer aluminum PowerBook and gave the broken one to me, even though we ended up fixing the case because it presented a power failure problem that was a show-stopper.

I actually rarely use the PowerBook, but the main reason he gave it to me was so that I could have a computer while in Italy for the upcoming academic quarter. Obviously I can't take my iMac, so the PowerBook is all prepped and ready to go. I do use it occasionally for other purposes, though, like for connecting it to the stereo downstairs to play music (since we don't have AirPort Express yet), and for going on small trips. The most recent was out to northern Nevada to participate in the geophysics project, because I needed to keep a small journal to fulfill the rest of my field camp requirements. Needless to say I wanted all my music with me, and I had previously transferred the music from my iMac to my PowerBook, and I try to transfer the new stuff over every once in a while. The iPod is kind of useless for this purpose unless you use a third-party utility.

Because I let iTunes manage the folder structure of my music on the hard drive, I only needed to copy my whole Music folder onto the PowerBook, open up iTunes, and set the correct path to the music library folder. Quitting and restarting iTunes would reveal my whole music library complete with playlists as well. It seemed like a perfect solution.

There's one small problem. The reason that iTunes remembered my playlists even though I hadn't transferred my iTunes prefs over is because it actually stores that information in the "iTunes 4 Music Library" file. Open your iTunes music folder, and then open up the folder named "iTunes". Inside you'll find a file called "iTunes 4 Music Library", assuming you've updated to the latest version. That's the file that stores your playlists. However, it stores some other information of which you may not be aware.

The problem became apparent when I connected my iPod to the PowerBook when I was on the road. I have my iPod set up to auto-sync, and to my horror, my iPod launched iTunes and started auto-synching (the library it's actually connected to is the one on my iMac, and an iPod is only supposed to be connected to one computer at any time)! Unfortunately, I was too late to stop it -- the auto-synch had deleted music from my iPod that was on my iMac but not on my PowerBook, and I was away from home so I couldn't restore the music. Deleting the all the iPod and iTunes prefs in the regular library folder didn't solve the problem.

It turns out that this "iTunes 4 Music Library" file is the culprit. Not only does it store your playlists, but also which iPod(s) are connected with the library on your computer. So if you copy this file over to a new computer, the iPod will be connected to both computers. (The actual iPod preferences, like whether to enable FireWire disk use and whether to auto-sync or use manual management, are actually stored on the iPod itself. So if you connect an iPod to one computer, enable manual synching, and then connect it to a completely new computer, iTunes will still know that manual synching is enabled.)

So if you're in a similar situation, simply delete the "iTunes 4 Music Library" file. On the next launch of iTunes, all your playlists will be gone and iTunes will think you have no music in your library. But that's not a problem -- simply go to your main computer, switch to iTunes, select "Export Library..." from the File menu, save the file and transfer it to your secondary computer. Then delete your "iTunes 4 Music Library" file, launch iTunes, select "Import..." from the File menu, and choose the exported library file. iTunes will then recreate the iTunes Music Library file on your secondary computer, complete with all your old playlists just as you made them (but not with your old iPod connection). It seems to even be intelligent enough to find the corresponding music files on your secondary comp's hard drive, and even change the ID3 tags to match your main library! Very spiffy.

You also may be wondering about all those other library files. You may have one called "iTunes 3 Music Library", "iTunes 4 Music Library (Old)", "iTunes Music Library (2)", or "iTunes Music Library.xml" inside the "iTunes" folder. You may also have a "library.xml" file in your main music folder. You can safely delete all these files -- the only important one is "iTunes 4 Music Library". (The "iTunes Music Library.xml" file will actually be recreated from the "iTunes 4 Music Library" file, but to do the reverse, you must use the "Import..." option from within iTunes.)

If you want an efficient way to keep the music libraries on your two computers in sync, consider the following AppleScript that I made specifically for this purpose. It takes most of the pain out of transferring the files, especially if you have iTunes manage the folder organization of your music library.

First, download the script. Then, go to your home folder in the Finder, open "Library", and open "iTunes". If you don't have a "Scripts" folder in there, create it. Then drop the downloaded script in there. Switch to iTunes, and you should see a little script icon between the Window and Help menus. If you select this menu, you'll see the script in that menu.

Now, select any tracks you want to transfer to another computer (you can use the library or any playlist to do this). Then select the script from the script menu. It will ask you for a location, and then will proceed to copy all the music files to that location in the Finder. Then you can simply transfer them all over to a computer in one fell swoop, since they'll all be in one location. (Without this script, you'd need to manually find them and move them to one location.) Of course, you could mount your secondary computer as a server first, and then use the script to transfer them directly to the other computer. Combine this with a smart playlist that keeps track of any songs that you've added after a certain date, and it's pretty simple to easily keep your libraries in sync.

I might update it to keep track of the last manual sync so you don't have to remember yourself (and wouldn't have to select the songs yourself), which would be a nice improvement. But for now it suffices for me.

Technological Supernova   Unfiled   Older   Newer   Post a Comment