Published by marco on
This is a synopsis of the instructions I found at New PC & moving itunes library, which didn’t strike me as concise or to-the-point enough for the less-savvy user.
This guide is for people who do not let iTunes organize their music for them.[1] It further assumes that you’ve already copied your music files (mp3, m4a, ogg, etc.) to the new computer. This guide will show you how to make iTunes on the new computer use the ratings, play count and other information from the old computer.
If you have the same folder for music files on both computers, you do not need this guide. This guide will work for transfers between Mac and Windows computers.
iTunes stores your music library meta-data in two files, both of which are stored in your iTunes Music folder. This guides will refer to that folder as ~/Music
; the real location is C:\Documents and Settings\<User name>\Music\iTunes
on Windows and /Users/<User name>/Music/iTunes
on Mac OS X. Inside this folder, you’ll see two (2) files and two (2) folders.
iTunes Library
[2] is a binary file that contains all of your meta-data in a quick-loading database.iTunes Music
is a folder that contains all of your imported Music.iTunes Music Library.xml
is an XML file that replicates your meta-data in an easy-to-read text format.Previous iTunes Libraries
is a folder that contains backup files created during upgrades from other iTunes versions.Copy the iTunes Library
and iTunes Music Library.xml
files to the ~/Music
folder on the new machine.
The next step is to tell iTunes where the actual music files are located. You will have to adjust the library description for each of the song files.
Open iTunes Music Library.xml in a text editor[3]. Inside this file, there are several sections, but mainly two large one: one for tracks and one for playlists. Tracks have many, many fields, but the important one is highlighted below:
<key>Tracks</key>
<dict>
<key>40</key>
<dict>
<key>Track ID</key><integer>40</integer>
<key>Name</key><string>[Title]</string>
<key>Artist</key><string>[Artist]</string>
<key>Location</key><string>file://localhost/Users/Shared/Music/Funk/[Artist]%20-%20[Title].mp3</string>
</dict>
…
The line you will have to change is that for the Location
key. In the example shown, the music library is found in /Users/Shared/Music
. Replace this string with the location of the library on the new computer. Some tips:
file://localhost/
part at the front of the file name.D:\Shared\Music
, the file location should start with file://localhost/D:\Shared\Music
You will not need to change anything for playlists.
If you start iTunes now, it will completely ignore the paths you put in, magically restoring the paths from the old computer and overwriting the file you painstakingly modified. Well done, iTunes. It’s actually loading the whole library from the other file, the iTunes Library
. As long as iTunes can read from this file, it will not load from the XML file. If you remove the file entirely, iTunes will not load anything. Tricky, but not insurmountable.
iTunes Library
in the same text editor as before. It is binary information and is supposed to look like that.You’re done. Start iTunes and it will load the library from the XML file. Once it has imported this file (which can take some time with large libraries), it will ask you if it’s ok to ignore the corrupted iTunes Library
. Click “Yes” and you’re done.
Keep iTunes Music folder organized
and the Copy files to iTunes Music Library when adding to library
are unchecked in the Advanced / General tab in the preferences.↩