Changing location of files in iTunes Library

Annoyingly, when my external hard drive died a month or so ago and I restored my iTunes library to a new HDD, I copied them to slightly the wrong location. Now when I try to play half of my library I get an error saying that iTunes can't find the file. This doesn't apply to all the old files in my library (ie the all the ones that were restored), but it's happened to at least 5000 tunes.

I need to change the file reference in the iTunes database from:

file://localhost/F:/iTunes/iTunes%20Music/Music/Artist/etc

to

file://localhost/F:/iTunes/iTunes%20Music/Artist/etc

I can edit the iTunes Library.xml, but when I then open iTunes, it gets overwritten with the old references in the iTunes Library.itl file. And I can't find a way to edit the itl file or import into it.

I've tried googling and mining the Apple support forum, but I'm not getting anywhere. I really want to avoid having to reimport the whole library (thus losing ratings and playcounts etc).

Can anyone help?

Ipod Touch 2G 16Gb, Windows XP

Posted on Jul 5, 2010 8:30 AM

Reply
2 replies

Jul 5, 2010 11:31 AM in response to Kirsty Chestnutt

You can edit the iTunes Library.xml file and use the edited XML file to rebuild the ITL database.
This will keep all metadata except Date Added.
If you care about Date Added, your only option is to re-link the files one-by-one.


iTunes has to have an ITL file to open & run. There are 3 ways it gets one:
1) If no valid ITL file exists, it creates a new one (blank library) and ignores the edited XML file.
2) If it finds an existing ITL, it uses it and ignores the edited XML file.
3) If it finds a valid but damaged ITL, it looks for an XML file and tries to rebuild the ITL from that.


You need to edit the XML file like you did before.
Then damage the ITL. Open the ITL in WordPad, select everything, and hit delete. Save it with zero bytes (nothing) in it.
This will force itunes to re-create it by looking at the XML file.


Be sure to make a backup of the XML before doing this, in case you need to tweak the process of editing it.

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.

Changing location of files in iTunes Library

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