[iTunes Version 8.0.2.20 at the time of writing]

I’ve lost count of the number of times I’ve had to move all my files from one PC to another, either because I’m reinstalling Windows; I’ve purchased a new laptop, or any number of other reasons.

Keeping all your files, photos and music libraries intact has always been a bit of a challenge. Windows Vista makes things a little easier with a more Mac/Linux like approach to organising user’s files … but shifting all those files is still prone to error. The application that keeps tripping me up is iTunes, so I thought I’d share my tried and tested technique for keeping everything in order.

Obviously, if you’re new PC has the exact same directory stucture as the old PC, then chances are you can simply copy your entire Music or My Music folder, and everything will just work. However, if you’re moving from XP to Vista; to/from PC to Mac, or you’re using a different username, then you’ll need to read on.

WARNING: Before you perform any of these steps, make sure you deauthorize your iTunes account on your old PC! See here for more information …

There are a number of ways to move your entire iTunes library to a new PC. Lets have a look at them:

Technique 1 (Basic)

The easiest way is to simply copy your music files across, and then simply import them into iTunes on the new PC. This approach works just fine: all your music is intact, but you loose a lot of your original library data (playlists, playcounts, last played dates, etc). This may not be a problem if you have a small library, and dont rely on the functionality of Smart Playlists. However, many of us have huge collections of music, and have spent a lot of time organising them carefully.

Technique 2 (Tedious!)

iTunes has a built-in feature that helps you consolidate all your media files into the folder you’ve chosen to hold your music (typically /My Music/iTunes/iTunes Music ). The trick here is to use the feature to move your entire library to a folder at the root of the C: drive. Once moved, you can copy the files to your new PC and use the consolidate command again to move everything into the right place. This is quite time consuming, but if you’re not happy with the Technique 3, then here’s what you need to do:

  1. Open iTunes
  2. Open the advanced preferences (Edit -> Preferences -> Advanced (Tab) )
  3. Change the “iTunes Music folder location” to a new folder at the root of C: (e.g. “C:iTunes Music”)
  4. Make sure the “Keep iTunes Music Folder Organised” checkbox is checked.
  5. Click OK to close the preferences.
  6. Select “Consolidate Library…” from File -> Library.
  7. Once you click “Consolidate”, your iTunes music files will be moved to this new location … which will take some time!
  8. (Grab a beer and watch some TV)
  9. Once complete, you now need to copy the new folder across to your new PC. Make sure you place it in the same location.
  10. Then copy the iTunes Library.itl file from your music folder (“My Music/iTunes” on XP, “Music/iTunes” on Vista), and place it in a similar folder on the new PC.
  11. While holding down SHIFT, launch iTunes on the new PC.
  12. Select “Choose Library …” from the dialogue box, and locate the iTunes Library.itl file you just copied.
  13. Hopefully iTunes will now open with all your music intact. However, it’s not a good idea to leave your music folder at the root of the C: drive …
  14. Repeat steps 2 to 7 again, but set your “iTunes Music folder location” to something logical within your music folder. (e.g. /Music/iTunes/iTunes Music/).
  15. Relax. You’re done.

Personally, I find this method very tedious, as you’re needlessly copying files again and again.

Technique 3 (My favourite)

I got to thinking: there must be a simple way for me to explain to iTunes that all the music files are simply in a different folder. Turns out there’s a way, but it involves a bit of XML editing. Here’s what you need to do:

  1. Open iTunes.
  2. Consolidate the library (File -> Library -> Consolidate Library …). (This is just good practice. It shouldn’t take long.)
  3. Now export the library (File -> Library -> Export Library)
  4. Copy your entire iTunes music folder onto the new PC. (Typically “/My Music/iTunes/iTunes Music/” or “/Music/iTunes/iTunes Music/”)
  5. Copy the exported library .XML file to your new PC. (Anywhere will do, so long as you can find it again!)
  6. On the new PC, locate and open the .XML file in Wordpad. (or your favourite XML editor – but Wordpad is fast for our needs).
  7. Scroll down until you locate an element of XML that looks like this:<dict>
      <key>Track ID</key><integer>4009</integer>
      <key>Name</key><string>You Can Call Me Al</string>
      <key>Artist</key><string>Paul Simon</string>
      <key>Composer</key><string>Paul Simon</string>
      <key>Album</key><string>Negotiations And Love Songs 1971-1986</string>
      <key>Genre</key><string>Rock</string>
      <key>Kind</key><string>MPEG audio file</string>
      <key>Size</key><integer>6833957</integer>
      <key>Total Time</key><integer>280398</integer>
      <key>Disc Number</key><integer>1</integer>
      <key>Disc Count</key><integer>1</integer>
      <key>Track Number</key><integer>16</integer>
      <key>Track Count</key><integer>16</integer>
      <key>Year</key><integer>1988</integer>
      <key>Date Modified</key><date>2005-07-17T00:07:08Z</date>
      <key>Date Added</key><date>2009-01-11T02:09:20Z</date>
      <key>Bit Rate</key><integer>192</integer>
      <key>Sample Rate</key><integer>44100</integer>
      <key>Play Count</key><integer>11</integer>
      <key>Play Date</key><integer>3300611948</integer>
      <key>Play Date UTC</key><date>2008-08-03T12:39:08Z</date>
      <key>Rating</key><integer>100</integer>
      <key>Album Rating</key><integer>100</integer>
      <key>Album Rating Computed</key><true/>
      <key>Normalization</key><integer>496</integer>
      <key>Compilation</key><true/>
      <key>Artwork Count</key><integer>1</integer>
      <key>Persistent ID</key><string>89971E9CC8BE64CD</string>
      <key>Track Type</key><string>File</string>
      <key>Location</key>
        <string>file://localhost/C:/Users/Oli/Music/iTunes/iTunes Music/Negoti...20Me%20Al.mp3</string>
      <key>File Folder Count</key><integer>4</integer>
      <key>Library Folder Count</key><integer>1</integer>
    </dict>
  8. Locate the part I’ve highlighted in red (this path will differ from PC to PC).
  9. Using Wordpad, highlight that part of the path in your XML file and press CTRL-H to open the Find & Replace dialog.
  10. In the “Replace With” textbox, enter the new path for your music files. Make sure to use forward slashes “/”, not backward “” ones!
  11. Press the “Replace All” button, and wait a while.
  12. Once complete, Save and exit Wordpad.
  13. Open iTunes.
  14. Select “File -> Library -> Import Playlist…”, and choose to import the XML file we just edited. iTunes will spend a while importing the library.
  15. Once complete there’s a little tidying up to do, as you may find some duplicate playlists have been created, along with some static playlists for podcats, music, audiobooks, etc. Just go through and delete anything you dont want.
  16. That’s it!

Personally I prefer this third technique as it gives me complete control over the files. You just need to be careful when editing that XML file. I usually make a safety copy before I do any editing.

The only downside I’ve found to this approach (apart from the duplicate/extra playlists it creates) is if you’ve imported a lot of custom video to iTunes, and then manually changed their media type to “TV Shows”, you may find this process sets them back to “Movies”. If you have a lot of mixed TV Shows and Movies content, this could be a small headache. This problem doesn’t occur with any iTMS purchased content.

Finally, I’ve explained these steps with Windows XP or Vista specifically in mind. However, the same methods can be used on the Mac using Textedit. However, because of the way the Mac references files stored in the user’s home folder, you’ll probably never need to do this. Simply copy your files to your new Mac.

Please let me know if you have any better methods for moving your iTunes files.

Enjoy!


4 Comments

Rich B · 8 February 2009 at 4:35 pm

Good tips there Oli (and I know I always reply to your entries quickly, it’s just coincidence, I honestly aren’t sat here waiting…!).

I still can’t bring myself to let iTunes organise my MP3’s (yes I know, MP3’s are SO last year for all you AAC and FLAC heads), quite ironic really with me diving off head first into Database world…..imagine trying to mentally structure and manage MySQL data manually. But no, I tried it once and it did some extremely bizarre things with my folder structure (suppose that says a lot about the nature of my collection), it’s getting better though and I *could* almost tick the box these days, I trashed a large section of nameless ‘Tracks 1,2,3,4 etc etc a few years ago, couldn’t cope with them anymore.

And you are right yes, it’s all much easier on the Mac, just xfer the folder..! I’ve done it myself many times on the various Apple incarnations I’ve had over the past few years, everything always just re-appears as it was.

Oli · 8 February 2009 at 4:41 pm

Rich: Why dont you like the idea of iTunes organising your MP3s? I recon my library is about 50/50 MP3s and AACs. Neither iTunes nor I really care about the difference. They’re all just tracks.

Mind you – Its worth noting that the MP3 encoder that ships with iTunes is lousy. Maybe this intenionally so to try and get you to shift to AAC. It obviously worked on me!

And yes – how DO you manage to reply to my posts within 5 minutes?!

Rich B · 8 February 2009 at 5:05 pm

I think it’s from the old 3.11 File Manager days, I like to know myself where my stuff is and how it’s arranged….it’s a hard habit to break….also when I *lend friends MP3’s to listen to before they buy the music themselves* I always found it easier to find said files down in the nitty gritty, but mainly I think it’s just because I had a few self created compilation music CD’s (?) which iTunes thus split and dispersed into separate corresponding folders relating to the artist etc (i.e – organised).

As for the format, again it’s a legacy thing for *cough* cross compatibility, yes, I have friends who believe it or not didn’t have iPods but instead preferred to wrestle with convention inside the world of ‘Creative Labs’ (although I think most of them have come round now).

My MP3’s I always rip (sorry – *Backup*) as 320’s however, as well as purging all the unknown faceless files I also dumped anything at 128 but rate.

Can I go now or are you going to post again soon?

Oli · 8 February 2009 at 5:21 pm

You are excused. You may go ;o)

Leave a Reply

Avatar placeholder

Your email address will not be published.