Moving iTunes from one computer to another
August 20, 2008
I just bought a new computer – I’m using it now. The old one was a bit flaky. It had one small problem – it was made by HP. Not trying to be nasty, but Compaq used to be a great brand, then HP bought it and now its not. Overpriced, shoddy quality control, and half the time they just don’t work. Of course, HP also used to be a good brand and now HP are also overpriced, shoddy, and don’t work, so that’s what you get. Anyway, I got sick of those problems and got a new machine – the brand of which I won’t mention as this is intended purely as negative product placement, not endorsement.
Thing is, with a new computer, I need to move my iTunes library. All of it.
I could just move the music files, and re-import it, but a quick hunt of the interwebs tells you this is a bad idea. It seems iTunes may lose your play counts, last played, and other such metadata, which I kind of like having. (One iPod playlist is ‘not played recently’ – shuffling would be too easy – another is ‘purchased and never played’. I need my metadata.)
In short, what I want to do is copy all the music files onto the new computer, then copy all the iTunes metadata, then start iTunes on the new computer without it noticing its been moved.
In addition to the actual music, movies, and so on, iTunes has three metadata files. In Windows, these are usually at:
[user profile]\My Documents\My Music\iTunes\iTunes Library.itl [user profile]\My Documents\My Music\iTunes\ iTunes Library.xml [user profile]\Application Data\Apple Computer\iTunes\iTunesPrefs.xml
The iTunes Library files are the actual library – apparently duplicates, iTunes makes one from the other if it only finds one. I had a nasty moment back in the day when I was bad and didn’t have proper backups, and my iTunes Library.xml file got deleted – but iTunes rebuilt it from the .itl file when it was next started, so all was well. The iTunesPrefs.xml file contains, well, preferences. You might need to change some Windows view settings to see the Application Data folder.
The problem is that my music collection on my old computer has grown – and spilled over into an external hard drive.
I could keep using that drive – but why, when I have a shiny new hard disk inside the new computer’s case. I want to consolidate everything into one physical disk without iTunes noticing. Now, sure, I could probably let iTunes do this. Except it would take a long, long time, and I’d rather do things myself than turn any software lose on a large and important (to me) collection of files. I could also try and search and replace one directory string for another inside the iTunes xml file, but I have no idea how consistently this would work and don’t want to pick up the pieces of ten thousand lost songs if something goes wrong.
There’s a much easier way: replicate the old disk structure on the new computer and don’t tell iTunes anything changed. Again, there’s two ways to do this. I could repartition the new hard disk and create the same logical disk structure as was on the old disk. But that takes time and effort – new computers come with everything installed, and I expect to be buying a new, bigger disk in a year, so why make more work if I can kludge it.
Which I can.
The old DOS subst command still lurks beneath Windows XP. (Yep, I got the downgrade rights. I use iTunes – obviously – why do I care about Vista’s slight benefits when its had so much horrendously bad press. I’d almost say Bill, come back, we miss you.)
subst is there. The syntax is subst drive folder. It’s a map network drive in reverse.
So I create a folder on the C: drive to hold all the external drive’s old data. The drive used to be called F:, so imaginatively I’ll call that folder F_drive. I could use a space and quote marks in the subst command, but underscores are that much geekier.
Then I create a batch file called, say, logon.bat. (A batch file is a text file – in Notepad – with the extension .bat rather than .txt). The single line in the batch file is:
subst f: c:\F_drive
Or if you prefer not to underscore, this will also work:
subst f: “c:\F drive”
I want the logon.bat script to run each time Window starts, so I can just put its name in one of the registry keys that Windows uses for this purpose – like autoexec.bat under DOS. Oh yeah, don’t play with the registry, back it up, don’t blame me if this goes wrong, blah blah.
Seriously.
Don’t do this if you don’t know how to use the registry editor. Messing this up can be very bad (although I’m not quite sure how you’d mess up editing a single key – but random deletions due to mistyping would in fact be extraordinarily bad).
One key that will autorun whatever’s stored there – and this is just the one I happen to use, there are others – is:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
The important one of the several values of this key is load. If it isn’t there, just add it as a String value. Put the full path to your logon.bat file in the load value, for example, c:\logon.bat
That’s all. Log out and back in. You should see an F: drive in My Computer.
If you don’t, if you see one of your external drives in place of the fake F: drive you expect, this is because Windows assigns drive letters earlier in the boot process than it runs the logon.bat script. You might need to reassign your drive letters with the Disk Management utility in Administrative Tools – Computer Management.
And after all that I did all the copying. Which took a long, time time.
When I started iTunes everything worked perfectly, completely seamlessly – my local iTunes didn’t seem to notice and still opened onto the last playlist I’d used. I had to log back into the iTunes store – it obviously picked up that this was a different computer – and obviously I also had to authorize my purchases on the new computer, but other that, no problems at all.
Like last time, sorry I’m not more help to Apple people, but I assume you can do something similar – and probably more easily, since you have unix running under the GUI. I assume you can mount the folders in a similar way and iTunes wouldn’t notice, but I couldn’t tell you how to actually do it.
WHAT I’M LISTENING TO: Very little right now as I just finished watching my music copy from one drive to the other.