Skip to content

Putting your iTunes library on a portable drive in Windows

Finally, the post about symlinks in Windows and how they come in handy.

Many people out there, including me, have a gazillion MP3’s that would never fit on any iPod no matter how bloated they become. The solution is, of course, to put them on an external drive, so at least you can listen to them wherever there is a computer.

However most media players, including iTunes and Windows Media Player, keep a separate database of all your MP3’s which includes how many times you’ve played each one, your rating, etc. So moving your MP3 files to the portable drive isn’t enough if you care about this information (in the case of iTunes, playlists also get stored in the library so it’s annoying as hell).

By the way, don’t use Windows Media Player; the newest versions seem like they never finish them before they release them. They are full of bugs and you run the risk of screwing up your ID3 tags if you use it to edit them. iTunes sometimes seems like a bloated craphole of “design” for people with tight jeans and dirty t-shirts driving around in automatic Audi A4’s, but it still seems to be the best (haven’t tried Winamp since the 2.x days). Moreover, iTunes has a COM interface so you can write your own programs to overcome its occasional stupidity.

In any case, I wanted to put iTunes’s database on the external drive also so that if I move files around or create playlists it will remember them no matter which computer I used. Of course iTunes doesn’t let you choose where the library is; it is by default in the My Documents\My Music\iTunes directory.

In searching around I found a clever solution where some guy created a symlink from the appropriate directory in Mac OS X to whatever directory he wanted the library to actually be. Very clever indeed, except that symlinks don’t exist in Windows….

According to this and other sources, they have existed since NTFS 5.0 (Windows 2000), they are just not documented and not meant to be used (though Visual Studio 2005 does establish one).

Read the article first. Take all the warnings about the risks of doing this seriously, as Windows has been known to hiccup itself out of coherency for random reasons when you do this type of thing.

I used Junction Link Magic to do it on my computer. You can skip the search it does at the beginning since you are creating the junction link from scratch, but if you are trying to edit one you created previously you will have to wait until it finds it.

Go to the My Documents\My Music\iTunes directory and move the itl and xml files (and whatever else you want; the directory has to be empty at the end) to the new place where you want it to be; in my case it was V:\iTunesLibrary (a directory in my external drive). Then run Junction Link Magic and create a link from My Documents\My Music\iTunes to the new location. I would do this without Explorer (or any programs that are accessing the source folder, including iTunes) open because I tried it and Junction Link Magic will not give an error but will not create the link, either. If it does create the link, you should immediately see it listed in the main window.

Now if any program goes to the My Documents\My Music\iTunes directory (including iTunes, Explorer, command prompts, etc.) it will actually be reading the target location (in my case V:\iTunesLibrary) without even knowing it.

Some notes:

At least in Windows XP and 2003 server, once you plug in a portable drive and change the drive letter to something the OS will remember it for that drive. I usually pick a high-up letter in case I share network drives or add physical drives later, because a byproduct of this “memory” is that if the letter you assign to the portable drive happens to be a network share when you plug it in, the drive will be recognized but you won’t be able to use it until you disconnect the network drive mapping…. This is really annoying with digital cameras.

What happens if you run iTunes without the drive plugged in? Yeah, I was scared, too. But thankfully iTunes just thinks you don’t have permission to access the folder and quits—disaster averted.

You (obviously) have to create the junction link on every computer where you plan on doing this. Luckily it’s per-user so you don’t necessary piss your girlfriend off.

One Trackback/Pingback

  1. Donkeypuss's Wonderful World of Technology on Sunday, June 1, 2008 at 3:48 pm

    […] This post is somewhat in continuation to the post about putting your iTunes library on a portable drive. […]

Post a Comment

Your email is never published nor shared. Required fields are marked *