How to update your iTunes library and remove old file references

Recently I had this problem with iTunes.   I moved all my music from a folder on my Desktop to inside My Documents. I had updated the Preferences section and iTunes decided to keep 2 copies of each file. One that worked and one that was a ghost entry.

So, I looked on instructions on how to update your itunes library and remove old file references. It took me an age and they were all very techie. So, I have tried to make a simple guide for the lay-man.

  1. Exit iTunes
  2. Backup your music if it is inside the iTunes folder (just in case)
  3. Open the “iTunes Library.itl” file with something like NotePad or Wordpad. Select all text (Ctrl+A) and delete. Make sure this is completely empty. Mine was located here  C:Documents and SettingsalandMy DocumentsMy MusiciTunes
  4. Open the “iTunes Music Library.xml” with something like Notepad and do a global search and replace of your old location with your new location. E.g. Find “C:Documents and SettingsProfileNameDesktopAdrian’s music” with “C:Documents and SettingsProfileNameMy DocumentsAdrian’s music”.
  5. And Save the XML file with the same name in the same location.
  6. Open iTunes. You will get a prompt that iTunes is rebuilding your library. It will take a while if you have a big archive. It will tell you that the library file is corrupt. Just follow the prompts and allow it to rebuild it all.
  7. Use iTunes as before. It should of kept your ratings, last played etc. It did for me.

Good luck and let me know how you get on.

8 thoughts on “How to update your iTunes library and remove old file references

  1. neil brown

    I hate Itunes, if you are not careful it can through your music and start rearranging your folders and converting the file format of your mp3’s. This can be resolved by going into the advanced options and unticking these options. If your like me and hat Itunes then there are alternatives but unfortunately will not work with all the mac mobile devices especially the Iphone and Itouch

    Anyway you may want to try winamp http://www.google.com/url?q=http://www.winamp.com/
    or media monkey
    http://www.mediamonkey.com

    Reply
  2. Andy

    Thank you Adrian.

    An excellent guide without installing third party software.

    For others, it takes a while (even in notepad) but worked correctly on my Windows7 dual core PC with iTunes 10.1

    Reply
  3. Pascal

    Hey thank you Adrian!

    I did not changed my folder but did some file updates using Media Monkey, which is more powerful than iTunes but iTunes was not getting these updates unless when asking to see each file’s information… so it was very long. Based on your tips, I deleted the file iTunes Music Library.xml so iTunes had to set up a completely new one so it searched for track information that was up to date due to MediaMonkey and everything was fine!! ;o) Tracks, illustrations, etc was now updated so that’s a very easy way to do things!

    thanx again!

    Reply
  4. Ole Reidar Johansen

    For some odd reason iTunes allows duplicate references to the same file. I had 7000 dupes. Since I took a chance and didn’t back up first I only had to delete the “iTunes Library.itl” file and do a restart! Yay! Sure beats removing 7000 dupes manually. Thankx.

    Reply
  5. Shan Heer

    Thanks Adrian!

    I didn’t even change the .xml file, because I had too many sourcefiles to begin with. But that didn’t matter, iTunes did what I wanted to: remove the old files.

    Reply
  6. Pingback: Editing iTunes references and file locations | The Blog

  7. Pingback: Recover iTunes purchases! | Domarius – Technical

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>