so unless you’ve been living under a rock, you know that we’ve moved to Slovakia. during the move, I was unable and unwilling to pack my computer up to bring with us. it was just too large to be feasible. the next best thing was to backup my digital life onto an external hard drive–which chelsea so conveniently gave me for christmas–and bring that with us instead. one problem with this is that, as with every other time that I had to wipe my hard drive, I would be forced to re-import my entire iTunes library into iTunes, and if you’ve ever tried to import an iTunes library, it’s better than starting from scratch, but it sucks. playlists don’t sync properly, especially if they are based on other playlists. and the add date for all your songs becomes the same date, which I use in many of my playlists (recently added, etc.) but I think I found a solution to my problems…
my parents were in a situation where they were using several user accounts on the computer, but wanted to share the iTunes library across all the accounts. this posed some problems, and I hacked in a workaround, where iTunes stored all the music in the same folder, but it wasn’t elegant, and it didn’t work quite right.
they recently had some computer issues which forced them to reformat their hard drive (ok, fine, forced ME to reformat their hard drive), and they again wanted to share the same iTunes library. so while thinking over how I could more easily get their iTunes library to work across multiple accounts, and be more elegant than the solution I tried last time, I realized that the same solution could possibly work for me.
the solution that I realized for my parents computer and their multiple accounts is as follows: on a *nix system, there is a thing you can do called a link (more precisely, a symbolic link), where one location actually points to another location. for instance if I had a directory at /bin which has a symlink pointing to it at /home/usr/bin, when I go to /home/usr/bin, I’m actually getting the contents of /bin, but the computer thinks I’m getting /home/usr/bin. a bit confusing i know, but trust me, it’s cool and extremely useful.
if you are using windows, windows doesn’t have symlinks per se, but if you’re using the NTFS file system (and if you’re on anything above win 2000, you should be), there is an almost identical thing you can do called a junction. and it’s made easier by downloading a small utility called NTFS Link. with this, you can point any empty folder to any other folder on the computer, and when you navigate to that folder, the contents inside are actually in another location on the computer. this gave me an idea…
iTunes has a horrible habit of wanting to store it’s data files in the documents folder of the user. this poses a problem for trying to use the same library for multiple accounts, as each account has it’s own documents folder. what I did, was created a new folder in the root of the C: drive called “iTunes”, and created another folder inside that folder called “__iTunes Data” (the underscores are to keep it near the top of the folder when sorted). I then opened iTunes with one of the accounts on the computer, which created the folder \My Documents\My Music\iTunes. I then closed iTunes, and moved the contents of that folder into the __iTunes Data folder I just created. after that, I right clicked on the now empty \My Music\iTunes folder and symlinked it to the __iTunes Data folder. now, iTunes goes looking for it’s data in the \My Documents\My Music\iTunes folder, but it’s actually looking in the C:\iTunes\__iTunes Data folder, but it has no idea. I then get into iTunes, and set the advanced preferences and change my iTunes Music Folder location to C:\iTunes.
mission accomplished. iTunes now thinks that it’s accessing it’s data in the documents folder, when really it’s in a different location (__iTunes Data), which can easily be linked to from all the other iTunes “accounts”. just do the same thing for the other accounts, make a junction from \My Documents\My Music\iTunes to C:\iTunes\__iTunes Data, and set your library location in iTunes to point to C:\iTunes, and everybody is now using the same library. one thing to make sure you set, is while you’re setting the Music Library location, also check “Keep iTunes Music folder organized” and “Copy files to iTunes Music folder when adding to library” this keeps everything nice and tidy, and when one account adds music, it gets copied into the iTunes music folder, and all the other accounts can access it as well.
now on to how this helped me… I realized that, while this works perfectly for multiple accounts on the same computer, my problem is a bit different. I have only one account, and all of my data is on an external hard drive, including my library data files. so what did I do? I set up iTunes exactly as I had set up the iTunes for my parents, except that I then emptied out and linked the C:\iTunes folder to the location of my external hard drive library (which is at G:\Music\Benjam’s Music). so now I have a perfectly functioning iTunes library, with no import required, and to top it off, when I need to wipe my hard drive again, I just set this up as it is now on the “new” computer, and it will behave as if it had never changed. all I might have to change is where C:\iTunes is pointing to.
here are those instructions again, in a nice easy-to-follow list (this only works with NTFS on XP, although if you have another method of creating symlinks in your system (which Vista does, google “mklink”), that would work as well):
- download and install NTFS Link
- download and install, or update iTunes
- create a folder in the root of your C drive called iTunes (or whatever)
- [Optional step] right click on your new folder and link to the location of your iTunes music
- create a folder inside C:\iTunes called __iTunes (or whatever)
- [Skip this step if you have an existing library] open iTunes once (this creates the \My Music\iTunes directory and creates some initial files in there)
- go to the iTunes preferences, and the Advanced tab, and set the location for the iTunes Music Library to C:\iTunes
- check both of the boxes below that, save, and close iTunes
- move all the files in \My Music\iTunes into C:\iTunes\__iTunes
- alt click on \My Music\iTunes and NTFS link that to C:\iTunes\__iTunes
- open iTunes, add your music, enjoy
(this also works with pre-existing libraries, just move your music into the C:\iTunes folder, and move your \My Music\iTunes data into the __iTunes folder, and iTunes will see it like nothing changed)