[iTunes Version 126.96.36.199 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:
- Open iTunes
- Open the advanced preferences (Edit -> Preferences -> Advanced (Tab) )
- Change the “iTunes Music folder location” to a new folder at the root of C: (e.g. “C:iTunes Music”)
- Make sure the “Keep iTunes Music Folder Organised” checkbox is checked.
- Click OK to close the preferences.
- Select “Consolidate Library…” from File -> Library.
- Once you click “Consolidate”, your iTunes music files will be moved to this new location … which will take some time!
- (Grab a beer and watch some TV)
- Once complete, you now need to copy the new folder across to your new PC. Make sure you place it in the same location.
- 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.
- While holding down SHIFT, launch iTunes on the new PC.
- Select “Choose Library …” from the dialogue box, and locate the iTunes Library.itl file you just copied.
- 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 …
- 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/).
- 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:
- Open iTunes.
- Consolidate the library (File -> Library -> Consolidate Library …). (This is just good practice. It shouldn’t take long.)
- Now export the library (File -> Library -> Export Library)
- Copy your entire iTunes music folder onto the new PC. (Typically “/My Music/iTunes/iTunes Music/” or “/Music/iTunes/iTunes Music/”)
- Copy the exported library .XML file to your new PC. (Anywhere will do, so long as you can find it again!)
- On the new PC, locate and open the .XML file in Wordpad. (or your favourite XML editor – but Wordpad is fast for our needs).
- Scroll down until you locate an element of XML that looks like this:
<key>Name</key><string>You Can Call Me Al</string>
<key>Album</key><string>Negotiations And Love Songs 1971-1986</string>
<key>Kind</key><string>MPEG audio file</string>
<key>Play Date UTC</key><date>2008-08-03T12:39:08Z</date>
<key>Album Rating Computed</key><true/>
<key>File Folder Count</key><integer>4</integer>
<key>Library Folder Count</key><integer>1</integer>
- Locate the part I’ve highlighted in red (this path will differ from PC to PC).
- Using Wordpad, highlight that part of the path in your XML file and press CTRL-H to open the Find & Replace dialog.
- In the “Replace With” textbox, enter the new path for your music files. Make sure to use forward slashes “/”, not backward “” ones!
- Press the “Replace All” button, and wait a while.
- Once complete, Save and exit Wordpad.
- Open iTunes.
- Select “File -> Library -> Import Playlist…”, and choose to import the XML file we just edited. iTunes will spend a while importing the library.
- 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.
- 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.