Manually Altering iTunes Music Library.xml

I just got an Airport Extreme for the AirDisc option. I followed the instructions posted at
http://www.tuaw.com/2007/03/02/tuaw-how-to-use-your-itunes-library-over-airport- disk/2#comments
for how to move my iTunes library over to my AirDisc. It didn't work. I opened up my iTunes Music Library.xml file and noticed that the location section of each song was still listed as being on my local hard drive, even though I had changed the iTunes directory in the Advanced section and made the other changes. Note the <key>Music Folder</key> was correct.

Then I did something stupid. I decided to add all the tracks again to the library. I did this because I made a copy of the xml file and the iTunes Library file, figuring I could replace all the entries by using a test editor.

Instead of going whole hog and taking my newly generated xml file and adding in my playcounts and ratings, I decided to mess around with the file. I've taken a sample track and changed the play count from 1 to 2 using TextEdit. After doing this I reopenned iTunes and saw that the playcount for that particular song remained at 1. I quit iTunes and reopenned the xml file and the play count was changed back to 1.

So two questions -

1) is there anyway to alter the iTunes Music Library.xml file and have the changes be permanent?
2) If not, is there any steps I can take to restore my ratings and playcounts?

Thanks,

Andy

MacBook Pro Core Duo, Mac OS X (10.4.9)

Posted on Jun 20, 2007 3:10 AM

Reply
4 replies

Jun 20, 2007 8:26 AM in response to William A Stetzler

The XML file isn't what iTunes uses for it's own information; the XML file is basically an exported copy for other applications to use. iTunes reads the iTunes Library file, not the XML. So if you just edit the XML file and change nothing else, not only will iTunes not change, it will overwrite the changes you made to the XML file.

The only way I can think of to be able to edit the XML file and have it reflected in iTunes would be to make your changes, trash the iTunes Library file, then choose the Import command and select the edited XML file. I've not tried it, but in theory that would work.

Warning: I strongly recommend that you work with a copy of the XML file, not the original, and that you keep a copy of the original XML and iTunes Library files so that you can restore them in case something goes wrong.

Jun 20, 2007 11:22 AM in response to greg h

are they supposed to reside on the computer's internal HD even when the music files are relocated to an external?

It depends on how you have iTunes set up and what version of iTunes you have. With iTunes 6 and earlier, those files must reside in your user's Music -> iTunes folder, though you can locate the music folder itself elsewhere. With iTunes 7, those files can also be located elsewhere, and you select that different location by holding down the Option key while launching iTunes. But in either case, iTunes won't go looking for other copies of the files, so there's no problem with you keeping backup copies elsewhere; iTunes won't switch to using those on it's own.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Manually Altering iTunes Music Library.xml

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.