How To Rebuild Your iTunes Library

Note: Since iTunes 12.2, iTunes no longer creates the iTunes Library.xml file, which I mention below, by default. It’s a good idea to tell iTunes to do this, so you can recover your library from that file if necessary. To do this, go to iTunes > Preferences > Advanced, and check Share iTunes Library XML with other applications.

Every now and then, an iTunes Library has problems. You may have tracks or songs that disappear in the library, but that are still in your iTunes Media folder. Or playlists may change or disappear. Or there may be other, inexplicable problems.

One way to try and fix these issues is to rebuild your iTunes library. I’ve done this from time to time, and it can solve some issues, and has even fixed problems with Genius.

It’s a simple process, but one that may take a while if you have a lot of content in your library. Here’s how you do it.

  1. Back up your iTunes Media folder. While rebuilding the library doesn’t affect your media files, it’s best to be safe.

  2. Quit iTunes, then find your iTunes folder. If you’re on a Mac, it’ll be in the Music folder in your home folder (that’s the one with the house icon and your user name). On Windows, it can be in different locations according to the version of Windows you use:

  • Windows XP: \Documents and Settings\[your username]\My Documents\My Music\
  • Windows Vista: \Users\[your username]\Music\
  • Windows 7 or later: \Users\[your username]\My Music\

The two files you’ll be using are iTunes Library.itl (or, perhaps, just iTunes Library) and iTunes Library.xml.)

Itunes library files

  1. Make copies of all these files; again, just in case.
  2. Move the iTunes Library.xml or iTunes Music Library.xml file to your Desktop or to another folder. You’ll be using this file to rebuild the library.

  3. Delete the iTunes Library or iTunes Library.itl file by moving it to the Trash or Recycle Bin.

  4. Launch iTunes, and choose File > Library > Import Playlist. Navigate to the iTunes Library.xml file you moved earlier, and click Choose (Mac) or Open (Windows).

iTunes will now examine the XML file, finding all your tracks and playlists, and add them to your library. This will create a new iTunes Library.itl file. If you have a lot of content in your iTunes library, this will take a while. The last time I did it with a library of about 70,000 tracks, it took well over an hour, so be patient.

If for any reason it doesn’t, you can always quit iTunes, delete the newly-created iTunes Library.itl file, and replace it with the one you backed up.

One thing you’ll notice is that all the view settings you applied have changed. You’ll have to go back and reset them the way you want for each playlist. (Choose View > Show View Options to tweak these settings.) But the new library should contain all your media, and all your playlists. Also, the Date Added for all your iTunes content will be the date on which you rebuild the library.


Learn how to get the most out of iTunes with my ebook, Take Control of iTunes 12:



287 thoughts on “How To Rebuild Your iTunes Library

  1. Hi Kirk

    I had my iTunes on an external drive called “BigMo” and iTunes->Preferences->Advanced->iTunes Media Folder Location pointed to /Volumes/BigMo/iTunes … in that directory I had my .xml and .itl files. I have a lot of ripped CDs and I also subscribe to Apple Music.

    I moved the disk to a new computer, set my preferences the same but things got confused with all of my ripped files “gone” — iTunes wanted to download them. So I followed your instructions and waited for iTunes to chug along and it finally finished. I’m very happy with the results but, of course, there is a catch.

    My iTunes Library.itl and some other files now live in ~/Music/iTunes. I suppose that is ok but I’d rather have those files on the external hard drive. I’ve tried resetting my Media Folder Location to the default and then change it back to the original path but those files still want to live in ~/Music/iTunes … Is there a simple way to change it so those files will be on the external hard drive?

    • Why would you rather have them on the external drive? It’s certainly possible to do that – quit iTunes, move the files, then launch iTunes by double-clicking the .itl file – I’ve found that this can cause problems.

      • Thank you for the reply…

        Well, this may be a lame reason but I have a very old memory of setting up my library with the music files in one place and the xml file (back then) in another place and it proved to be awful… but I can’t remember what happened.

        One small nit is some of the data is such as Album Artwork is on the laptop. The iTunes directory on the laptop right now consumes 404M. I guess… today that isn’t significant.

        I’ll keep it like it is and see how it goes.

        Thank you again for the web page and the followup.

  2. Hi Kirk

    I had my iTunes on an external drive called “BigMo” and iTunes->Preferences->Advanced->iTunes Media Folder Location pointed to /Volumes/BigMo/iTunes … in that directory I had my .xml and .itl files. I have a lot of ripped CDs and I also subscribe to Apple Music.

    I moved the disk to a new computer, set my preferences the same but things got confused with all of my ripped files “gone” — iTunes wanted to download them. So I followed your instructions and waited for iTunes to chug along and it finally finished. I’m very happy with the results but, of course, there is a catch.

    My iTunes Library.itl and some other files now live in ~/Music/iTunes. I suppose that is ok but I’d rather have those files on the external hard drive. I’ve tried resetting my Media Folder Location to the default and then change it back to the original path but those files still want to live in ~/Music/iTunes … Is there a simple way to change it so those files will be on the external hard drive?

    • Why would you rather have them on the external drive? It’s certainly possible to do that – quit iTunes, move the files, then launch iTunes by double-clicking the .itl file – I’ve found that this can cause problems.

      • Thank you for the reply…

        Well, this may be a lame reason but I have a very old memory of setting up my library with the music files in one place and the xml file (back then) in another place and it proved to be awful… but I can’t remember what happened.

        One small nit is some of the data is such as Album Artwork is on the laptop. The iTunes directory on the laptop right now consumes 404M. I guess… today that isn’t significant.

        I’ll keep it like it is and see how it goes.

        Thank you again for the web page and the followup.

  3. Many thanks, Kirk. I had many duplicate songs that could not be deleted nor played (really weird), and your method was the only solution that fixed it. (iTunes 12.7.2.58 on the PC)

  4. Many thanks, Kirk. I had many duplicate songs that could not be deleted nor played (really weird), and your method was the only solution that fixed it. (iTunes 12.7.2.58 on the PC)

  5. Kirk, I thought this was exactly the answer to my problem. I have many songs and artists in my iTunes folder on my hard drive that do not appear in my iTunes library when I open it, so I thought if I rebuild the library that would do the trick. It still may, but here’s the problem: in my iTunes folder, there is an iTunes Library.itl file, but not an iTunes Library.xml file. What should I do?

  6. Kirk, I thought this was exactly the answer to my problem. I have many songs and artists in my iTunes folder on my hard drive that do not appear in my iTunes library when I open it, so I thought if I rebuild the library that would do the trick. It still may, but here’s the problem: in my iTunes folder, there is an iTunes Library.itl file, but not an iTunes Library.xml file. What should I do?

  7. Hey Kirk back to older Threads of yours regarding ITunes stealing/deleting my music. I have noticed little by little MANY OF my LOCAL MUSIC LIBRARY.. The Artists Folders/Album/Tracks are coming up Blank little by little NO TRACKS. Many of them Show an exclamation on iTunes. So if they are not in iTunes and Not my Local Library…where are they going?

  8. Hey Kirk back to older Threads of yours regarding ITunes stealing/deleting my music. I have noticed little by little MANY OF my LOCAL MUSIC LIBRARY.. The Artists Folders/Album/Tracks are coming up Blank little by little NO TRACKS. Many of them Show an exclamation on iTunes. So if they are not in iTunes and Not my Local Library…where are they going?

  9. Right when I was about to pull my hair out after uttering every swear word I try to avoid….BAM! I found your article. Thank you so much!!

  10. Right when I was about to pull my hair out after uttering every swear word I try to avoid….BAM! I found your article. Thank you so much!!

  11. Thank you!! I was struggling with the songs cutting off before the end issue, and mysterious duplicates … rebuilding the library seems to have fixed these. Is this a “relying on a gigantic database stored and used in a fashion that was never intended” issue?

  12. Thank you!! I was struggling with the songs cutting off before the end issue, and mysterious duplicates … rebuilding the library seems to have fixed these. Is this a “relying on a gigantic database stored and used in a fashion that was never intended” issue?

  13. Thanks Kirk. This article helped but a I have a couple of questions. First – background.
    – I have an Apple Music subscription
    – I moved my iTunes folder to a NAS a few months ago.
    – I redirected iTunes on my iMac to the new location for new adds.
    – I installed iTunes on a NUC PC I have in my office and pointed it to the same place. It gradually began to populate to satisfaction.
    – At this point I began moving music (mostly mps) from a failing hard drive from my old pc that I was able to fire up in an enclosure. The drive has some issues and so I had to restart it a number of times before the Windows 10 NUC would recognize it as anything but a RAW drive needing formatting. I knew it was not. Eventually I gained access to those files on the NUC. I am using the windows pc for this because the failing drive was formatted as NTFS.
    – I moved all of the mp3s off this drive and into the music file on the NAS. Barely made it as the drive failing drive started pulling its old tricks near the end,
    – At this time I began ripping my cd collection to the same file via an external drive I connected to my Mac. I am ripping in ALAC.
    – All was going well until I got somewhere into the G’s in the alphabet. At this point I started getting funky messages about a file that could not be saved or some such. A few other mystery errors as well. But the files were still ripping to the drive and showing up in iTunes so I kept going.
    – Next I see this error: ‘iTunes can’t verify the identity of the server “ace.noxsolutions.com”. I don’t know what this is. It is not the name of my NAS server.
    – Subsequently I get another error, this time ‘The iTunes Library file cannot be saved. An unknown error occurred (13010)’. Got this same error several times. But I was still able to rip cds to NAS that were showing up in iTunes.
    – At this time I also noticed about 20 iTunes tmp files now showing up. I let them stay for a bit and then trashed them.
    – another cd or two ripped and I got an error about corrupted itl file being saved as damaged. I tried to use an older itl file (only a few hours older) but things were getting weird. Now only purchased music was showing in library.
    At this time … I implemented the Kirk Plan.
    First time my library showed three tracks and spinning beachball for 8+ hours. I quit that process and tried it again. This time the library began populating. Over time and on completion … it looked like I was most of the way back … but three issues.
    1. Podcasts were showing up as tracks in albums in music. And it had bypassed my setup to pull in only most recent episode and instead pulled in all of them. While this is a PIA … I can get rid of this.
    2. All my playlists were duplicated…except that the duplicate playlist contained no tracks.
    3. I have ripped albums and tracks no longer showing in iTunes. They are still physically on the NAS in the same spot and if iTunes was scanning those files I would think they should have been picked up … but they were now. So far . the ones I am noticing seem to be the most recently ripped / added to library but it will require a closer look.
    Any thoughts on causes or remedies on any of these items. Not knowing bothers me. Its hard for me to just chalk things like this up to general funkiness.

    • Well, that’s a lot…

      First, it’s not uncommon for iTunes to not get along with NASes. That server might have something to do with the NAS software. It resolves to this: https://www.podcastone.com Not sure if your NAS is doing something with podcasts.

      Rebuilding a library on a NAS can take a long time. I think iTunes reads the files entirely to look for tags, even though it should only have to read parts of the files.

      As for 1, I don’t know; I hear that every now and then. 2, duplicate playlists, that’s not uncommon. I’ve heard from people who have thousands of playlists. And 3, you might need to re-add them, but it’s possible that your XML file was created before you added them to the library. Did you check the date it was modified before you imported it?

      But I don’t trust iTunes with a NAS any more. I’ve tried it a few times, and there have always been problems.

  14. Thanks Kirk. This article helped but a I have a couple of questions. First – background.
    – I have an Apple Music subscription
    – I moved my iTunes folder to a NAS a few months ago.
    – I redirected iTunes on my iMac to the new location for new adds.
    – I installed iTunes on a NUC PC I have in my office and pointed it to the same place. It gradually began to populate to satisfaction.
    – At this point I began moving music (mostly mps) from a failing hard drive from my old pc that I was able to fire up in an enclosure. The drive has some issues and so I had to restart it a number of times before the Windows 10 NUC would recognize it as anything but a RAW drive needing formatting. I knew it was not. Eventually I gained access to those files on the NUC. I am using the windows pc for this because the failing drive was formatted as NTFS.
    – I moved all of the mp3s off this drive and into the music file on the NAS. Barely made it as the drive failing drive started pulling its old tricks near the end,
    – At this time I began ripping my cd collection to the same file via an external drive I connected to my Mac. I am ripping in ALAC.
    – All was going well until I got somewhere into the G’s in the alphabet. At this point I started getting funky messages about a file that could not be saved or some such. A few other mystery errors as well. But the files were still ripping to the drive and showing up in iTunes so I kept going.
    – Next I see this error: ‘iTunes can’t verify the identity of the server “ace.noxsolutions.com”. I don’t know what this is. It is not the name of my NAS server.
    – Subsequently I get another error, this time ‘The iTunes Library file cannot be saved. An unknown error occurred (13010)’. Got this same error several times. But I was still able to rip cds to NAS that were showing up in iTunes.
    – At this time I also noticed about 20 iTunes tmp files now showing up. I let them stay for a bit and then trashed them.
    – another cd or two ripped and I got an error about corrupted itl file being saved as damaged. I tried to use an older itl file (only a few hours older) but things were getting weird. Now only purchased music was showing in library.
    At this time … I implemented the Kirk Plan.
    First time my library showed three tracks and spinning beachball for 8+ hours. I quit that process and tried it again. This time the library began populating. Over time and on completion … it looked like I was most of the way back … but three issues.
    1. Podcasts were showing up as tracks in albums in music. And it had bypassed my setup to pull in only most recent episode and instead pulled in all of them. While this is a PIA … I can get rid of this.
    2. All my playlists were duplicated…except that the duplicate playlist contained no tracks.
    3. I have ripped albums and tracks no longer showing in iTunes. They are still physically on the NAS in the same spot and if iTunes was scanning those files I would think they should have been picked up … but they were now. So far . the ones I am noticing seem to be the most recently ripped / added to library but it will require a closer look.
    Any thoughts on causes or remedies on any of these items. Not knowing bothers me. Its hard for me to just chalk things like this up to general funkiness.

    • Well, that’s a lot…

      First, it’s not uncommon for iTunes to not get along with NASes. That server might have something to do with the NAS software. It resolves to this: https://www.podcastone.com Not sure if your NAS is doing something with podcasts.

      Rebuilding a library on a NAS can take a long time. I think iTunes reads the files entirely to look for tags, even though it should only have to read parts of the files.

      As for 1, I don’t know; I hear that every now and then. 2, duplicate playlists, that’s not uncommon. I’ve heard from people who have thousands of playlists. And 3, you might need to re-add them, but it’s possible that your XML file was created before you added them to the library. Did you check the date it was modified before you imported it?

      But I don’t trust iTunes with a NAS any more. I’ve tried it a few times, and there have always been problems.

  15. Thanks Kirk, and thanks also to all your contributors in this thread. I now realise, after a couple of days scratching my head to no avail, that I should have read the thread backwards. This is the key entry for me:

    “But I don’t trust iTunes with a NAS any more.”

    However, I’m still puzzled. Why should the .xml file be any more reliable than the .itl file as a base for rebuilding the database? After all, aren’t they both the same core data written out by iTunes in different formats?

    FWIW my issue has arisen just recently where using a NAS (WD MyCloud) for the media files for iTunes has caused the NAS intermittently to “disappear” from the network. It happens on both Macs which use the NAS. It has worked reliably for over a year but a couple of weeks ago it started dropping the network connection so “something” changed – a new version of iTunes, an OS update, …?

    Looks as if I will have to go back to an attached hard drive.

    • The .itl file is more susceptible to corruption. It’s written every time there is a change in iTunes. The XML file, which is just a plain text file, isn’t written as often.

      As for the NAS, you might want to listen to this episode of my music podcast The Next Track.

      http://www.thenexttrack.com/40

      We discuss the problems with a NAS, and talk about an AppleScript that can improve its use with iTunes. But I won’t use a NAS any more; there are just too many problems.

  16. Thanks Kirk, and thanks also to all your contributors in this thread. I now realise, after a couple of days scratching my head to no avail, that I should have read the thread backwards. This is the key entry for me:

    “But I don’t trust iTunes with a NAS any more.”

    However, I’m still puzzled. Why should the .xml file be any more reliable than the .itl file as a base for rebuilding the database? After all, aren’t they both the same core data written out by iTunes in different formats?

    FWIW my issue has arisen just recently where using a NAS (WD MyCloud) for the media files for iTunes has caused the NAS intermittently to “disappear” from the network. It happens on both Macs which use the NAS. It has worked reliably for over a year but a couple of weeks ago it started dropping the network connection so “something” changed – a new version of iTunes, an OS update, …?

    Looks as if I will have to go back to an attached hard drive.

    • The .itl file is more susceptible to corruption. It’s written every time there is a change in iTunes. The XML file, which is just a plain text file, isn’t written as often.

      As for the NAS, you might want to listen to this episode of my music podcast The Next Track.

      http://www.thenexttrack.com/40

      We discuss the problems with a NAS, and talk about an AppleScript that can improve its use with iTunes. But I won’t use a NAS any more; there are just too many problems.

  17. Hell Kirk I have 2 ipod classics I couldn’t sync them So I called apple and the techs gave me the wrong info and it wiped my entire library out, but I backed it up it just won’t allow me to sync with my current library, if I load iTunes fresh on a new hard drive and put my old library in will it let me sync. or is there a away too clone my ipod with my wifes being they were the same before the chaos

    • You should be able to restore the iPod with iTunes, then sync your current library. That’s the best way when things go this wrong.

  18. Hell Kirk I have 2 ipod classics I couldn’t sync them So I called apple and the techs gave me the wrong info and it wiped my entire library out, but I backed it up it just won’t allow me to sync with my current library, if I load iTunes fresh on a new hard drive and put my old library in will it let me sync. or is there a away too clone my ipod with my wifes being they were the same before the chaos

    • You should be able to restore the iPod with iTunes, then sync your current library. That’s the best way when things go this wrong.

  19. Hey Kirk. Thank you as well. I am not able to import the playlist because it starts and then I get an error message, cannot locate the songs. I saved two library files so i have a 20,000 kb file in two locations.

  20. Hey Kirk. Thank you as well. I am not able to import the playlist because it starts and then I get an error message, cannot locate the songs. I saved two library files so i have a 20,000 kb file in two locations.

  21. Hi Kirk,

    I had this weird problem long time ago where iTunes would skip mp3 files before the end (it didn’t seem to affect AAC files). I solved it following this great guide. Now I’m using iTunes 12.7.5.9 on El Capitan 10.11.6 and my songs play just fine.

    HOWEVER, I’m seeing this bug persist in my iPod Video (5.5G), which is super weird as I’ve just restored it recently with iTunes. It’s the same nightmare I used to experience a few months back — mp3 files skipping before the end, only that in my iPod.

    I even ran a test and converted an album which would present this problem on my iPod. I made an AAC version of it, sync it and guess what… it plays just fine. On my iPod.

    Just in case, I have the Share iTunes Library XML with other applications option activated in iTunes.

    Do you think there might be a reasonable explanation as to why this problem persists on my iPod, even though it seems to be solved in iTunes on my Mac?

    • There are some weird things that can happen in MP3 files that can cause that to happen. As you say, converting it works fine, but I don’t know any other solution to fix it.

      • Thanks for your quick reply.

        Yeah, I was hoping I could find another solution and leaving the AAC option as a last resort. Converting files when we are talking about hundreds if not thousands is not a very practical solution, not to mention I’d have to do the same every time I add a new album to my library. I guess I’ll have to get use to it =(

  22. Hi Kirk,

    I had this weird problem long time ago where iTunes would skip mp3 files before the end (it didn’t seem to affect AAC files). I solved it following this great guide. Now I’m using iTunes 12.7.5.9 on El Capitan 10.11.6 and my songs play just fine.

    HOWEVER, I’m seeing this bug persist in my iPod Video (5.5G), which is super weird as I’ve just restored it recently with iTunes. It’s the same nightmare I used to experience a few months back — mp3 files skipping before the end, only that in my iPod.

    I even ran a test and converted an album which would present this problem on my iPod. I made an AAC version of it, sync it and guess what… it plays just fine. On my iPod.

    Just in case, I have the Share iTunes Library XML with other applications option activated in iTunes.

    Do you think there might be a reasonable explanation as to why this problem persists on my iPod, even though it seems to be solved in iTunes on my Mac?

    • There are some weird things that can happen in MP3 files that can cause that to happen. As you say, converting it works fine, but I don’t know any other solution to fix it.

      • Thanks for your quick reply.

        Yeah, I was hoping I could find another solution and leaving the AAC option as a last resort. Converting files when we are talking about hundreds if not thousands is not a very practical solution, not to mention I’d have to do the same every time I add a new album to my library. I guess I’ll have to get use to it =(

  23. After reading all the post, i’m still confuse on how to go about my problem. i accidently highlighted the songs in my itunes and gave them the same artist name, album name, artist album name and composer name. Is there a means by which this can be fixed. I have just my macbook pro and no backup

  24. After reading all the post, i’m still confuse on how to go about my problem. i accidently highlighted the songs in my itunes and gave them the same artist name, album name, artist album name and composer name. Is there a means by which this can be fixed. I have just my macbook pro and no backup

  25. Got an iTunes Library (Damaged). Could not find a recent iTunes Music Library.xml. Until I looked inside an #Recycle folder on the same level as the iTunes folder. Lots of numbered xml’s there, the most recent one was up-to-date and fixed my problem as described above.

  26. Got an iTunes Library (Damaged). Could not find a recent iTunes Music Library.xml. Until I looked inside an #Recycle folder on the same level as the iTunes folder. Lots of numbered xml’s there, the most recent one was up-to-date and fixed my problem as described above.

  27. Hi there,
    I backed up my music folder onto an external hard drive (using an imac).
    I deleted everything out of the music folder after that.
    Forgetting that it was needed for my itunes.
    Opened my itunes and it asked for the music files.
    I copied the files back to my imac and selected the xml file.
    It gave me playlists only up till 2015.
    All the rest, made over 3yrs of DJing are gone.
    I found this site did the copy the xml and the itl to the desktop thing as you’ve said.
    It’s now just duplicated the same playlists from 2015 inside my itunes.
    So now there’s an insane amount of the same stuff that was there before!

    Please, any help would be immensely appreciated.
    I noticed that my iTunes Music Library.xml file date was from October 2015.
    Why is that?
    :'(

    Cheers in advance.

    • As I point out, since iTunes 12.2, the XML file is only saved if you expressly tell iTunes to save it. So there’s nothing you can do. Unless you have Time Machine backups of the .itl file, in which case you can go back until you find a file that works. Sorry, but that’s the way iTunes works now.

  28. Hi there,
    I backed up my music folder onto an external hard drive (using an imac).
    I deleted everything out of the music folder after that.
    Forgetting that it was needed for my itunes.
    Opened my itunes and it asked for the music files.
    I copied the files back to my imac and selected the xml file.
    It gave me playlists only up till 2015.
    All the rest, made over 3yrs of DJing are gone.
    I found this site did the copy the xml and the itl to the desktop thing as you’ve said.
    It’s now just duplicated the same playlists from 2015 inside my itunes.
    So now there’s an insane amount of the same stuff that was there before!

    Please, any help would be immensely appreciated.
    I noticed that my iTunes Music Library.xml file date was from October 2015.
    Why is that?
    :'(

    Cheers in advance.

    • As I point out, since iTunes 12.2, the XML file is only saved if you expressly tell iTunes to save it. So there’s nothing you can do. Unless you have Time Machine backups of the .itl file, in which case you can go back until you find a file that works. Sorry, but that’s the way iTunes works now.

  29. Hi Kirk, I had some problems with my internal HD, 8 months ago, prepared an external disk (4TB, Thunderbolt) which is my boot drive now, with everything on it. My version of iTunes is 12.8.1.2, running on iMac with High Sierra.
    Now, for some time, I experience problems with the indication of ‘times played’ and ‘last played’ of tracks, some tracks do update and some do not after being played, I cannot see the difference between tracks that do the update and the ones not updating.
    Any clues? Thanks in advance.

  30. Hi Kirk, I had some problems with my internal HD, 8 months ago, prepared an external disk (4TB, Thunderbolt) which is my boot drive now, with everything on it. My version of iTunes is 12.8.1.2, running on iMac with High Sierra.
    Now, for some time, I experience problems with the indication of ‘times played’ and ‘last played’ of tracks, some tracks do update and some do not after being played, I cannot see the difference between tracks that do the update and the ones not updating.
    Any clues? Thanks in advance.

  31. All I want to do is have iTunes recognize all the music on my external hd. There are no playlists or anything. I’ve never used iTunes on this laptop, so I copied it over to the external I use with this machine.

    • Drop the folder containing the music files on the iTunes window. Make sure you set the iTunes media folder location to the external drive that contains your music.

  32. All I want to do is have iTunes recognize all the music on my external hd. There are no playlists or anything. I’ve never used iTunes on this laptop, so I copied it over to the external I use with this machine.

    • Drop the folder containing the music files on the iTunes window. Make sure you set the iTunes media folder location to the external drive that contains your music.

  33. HI there! Last year my entire hard drive crashed. I can’t get anything off it, so I tried using my iPods (one has podcasts, the other music only). I can’t find either the XML or ITL files. I was able to re add the podcasts, but at the cost of losing ALL info (i.e Date Added, Play Count, etc) I have the music on the other iPod organised by Date Added and play counts and the like, and it goes all the way back to September 2008. I don’t want to lose all the data and playlists (It’s 20k+ songs) but I would love to be able to start adding more music and updating it. I run on Windows 10, btw.

  34. HI there! Last year my entire hard drive crashed. I can’t get anything off it, so I tried using my iPods (one has podcasts, the other music only). I can’t find either the XML or ITL files. I was able to re add the podcasts, but at the cost of losing ALL info (i.e Date Added, Play Count, etc) I have the music on the other iPod organised by Date Added and play counts and the like, and it goes all the way back to September 2008. I don’t want to lose all the data and playlists (It’s 20k+ songs) but I would love to be able to start adding more music and updating it. I run on Windows 10, btw.

  35. Hi Kirk,

    thanks so much for this article. I have a question, maybe you can help. I have migrated from Old laptop (win) to new (macbook). I do not want to do this via the ‘consolidating librbary’ option since I also use external software for Djing (Traktor) so want to keep folder structure and source files the same since that software also uses these files so if I instead do the consolidating library backup I fear that will screw that software up a lot.

    The source audio files have moved over to the new computer via dropbox but are now of course in a different location as the mac path is different than the win path.

    When using the libraryITL file I cannot recreate my library as no files are found (different location I guess). Using your method I get the playlists back but all are empty, no tracks inside. None of my tracks are found. is there a way to fix this? E.g. by changing the path in the xml file that it refers to (it is of course still the location as if it was on my windows computer) as the file locations to reflect the new file path on the mac which will be something…../users/myname/dropbox.

    Any help would be greatly appreciated!

    • If you take the XML file and replace the path, then rebuild the library using that, it should work, but I don’t think iTunes likes Dropbox very well. I think there’s something special about the Dropbox folder. It’s worth a try, though.

      • I tried it and it worked. I first created a new library with only one song in it from the new Dropbox location on the Mac to get the path how it appears in the xml file on the Mac. Then I took the source xml file I had saved from my windows laptop and did a find replace on the relevant front section of the party up to the /Dropbox/music folder/ and that worked. I then rebuild the library on the Mac with that edited xml file. Thank you!

  36. Hi Kirk,

    thanks so much for this article. I have a question, maybe you can help. I have migrated from Old laptop (win) to new (macbook). I do not want to do this via the ‘consolidating librbary’ option since I also use external software for Djing (Traktor) so want to keep folder structure and source files the same since that software also uses these files so if I instead do the consolidating library backup I fear that will screw that software up a lot.

    The source audio files have moved over to the new computer via dropbox but are now of course in a different location as the mac path is different than the win path.

    When using the libraryITL file I cannot recreate my library as no files are found (different location I guess). Using your method I get the playlists back but all are empty, no tracks inside. None of my tracks are found. is there a way to fix this? E.g. by changing the path in the xml file that it refers to (it is of course still the location as if it was on my windows computer) as the file locations to reflect the new file path on the mac which will be something…../users/myname/dropbox.

    Any help would be greatly appreciated!

    • If you take the XML file and replace the path, then rebuild the library using that, it should work, but I don’t think iTunes likes Dropbox very well. I think there’s something special about the Dropbox folder. It’s worth a try, though.

      • I tried it and it worked. I first created a new library with only one song in it from the new Dropbox location on the Mac to get the path how it appears in the xml file on the Mac. Then I took the source xml file I had saved from my windows laptop and did a find replace on the relevant front section of the party up to the /Dropbox/music folder/ and that worked. I then rebuild the library on the Mac with that edited xml file. Thank you!

  37. Hi there,

    thanxx for this post. I’ve done this because I have ongoing problems iniTunes like audio book entries that are linked to apps and so on…
    My iTunes Library lives on a NAS since it’s really big and I don’t want that all on my local machine.

    While importing the XML iTunes constantly opens requester asking “A newer version of the app ‘…’ already exists in your iTunes library. Are you sure you want to replace it with the one you are moving?”

    SInce I don’t want so sit there and wait for the next one I put together a little applescript with UI scripting that answers the requesters.
    Maybe it’s useful for somebody else:

    repeat
    set classNames to {}
    tell application “iTunes” to activate
    tell application “System Events”
    tell front window of (first application process whose frontmost is true)
    repeat with uiElem in entire contents as list
    set classNames to classNames & (class of uiElem as string)
    end repeat
    key code 49 # space
    key code 48 # tab
    key code 48 # tab
    key code 49 # space
    key code 76 # enter
    end tell
    end tell
    if application “iTunes” is not running then exit repeat
    delay 3
    end repeat

  38. Hi there,

    thanxx for this post. I’ve done this because I have ongoing problems iniTunes like audio book entries that are linked to apps and so on…
    My iTunes Library lives on a NAS since it’s really big and I don’t want that all on my local machine.

    While importing the XML iTunes constantly opens requester asking “A newer version of the app ‘…’ already exists in your iTunes library. Are you sure you want to replace it with the one you are moving?”

    SInce I don’t want so sit there and wait for the next one I put together a little applescript with UI scripting that answers the requesters.
    Maybe it’s useful for somebody else:

    repeat
    set classNames to {}
    tell application “iTunes” to activate
    tell application “System Events”
    tell front window of (first application process whose frontmost is true)
    repeat with uiElem in entire contents as list
    set classNames to classNames & (class of uiElem as string)
    end repeat
    key code 49 # space
    key code 48 # tab
    key code 48 # tab
    key code 49 # space
    key code 76 # enter
    end tell
    end tell
    if application “iTunes” is not running then exit repeat
    delay 3
    end repeat

  39. Hi there!

    I am getting ready to move my itunes library to a NAS. At present,my Itunes folder has all the media (21,000 songs) AND the ITunes .itl, .xml and other related files in the same folder. I read that performance with itunes on the NAS will be faster if those files stay on my laptop.

    Every how-to i have seen doesn’t seem to address this. Can anyone give me step by step on how to do this? The goal is to have the media files on the NAS and the database files on the laptop.

    Thanks!

  40. Hi there!

    I am getting ready to move my itunes library to a NAS. At present,my Itunes folder has all the media (21,000 songs) AND the ITunes .itl, .xml and other related files in the same folder. I read that performance with itunes on the NAS will be faster if those files stay on my laptop.

    Every how-to i have seen doesn’t seem to address this. Can anyone give me step by step on how to do this? The goal is to have the media files on the NAS and the database files on the laptop.

    Thanks!

  41. Thanks a ton for this post! I’ve been puzzled by this for quite a while but didn’t give it much thought because it only affected a handful of songs and when I *did* search for a solution, all I saw were other people reporting similar issues with nothing helpful posted in response. However it started to expand lately and that was concerning so I started looking again. I figured it had to be a DB issue but had no idea how to address it until I found your post here. Happy days are here again!

    The really weird thing about this whole problem is that you would figure that deleting and re-adding that particular song would fix it but I guess the DB hangs onto songs it once knew about instead of completely deleting the entry like a well-behaved application… unless that was part of the effect of the corruption. Did the rebuild just as you suggested and it seems to have corrected the issues for me just like it was supposed to. Too bad Apple support couldn’t have dug into the reports more and come up with an answer years ago instead of giving everyone the generic un-helpful suggestions. :/

  42. I wish I could say your instructions worked, but sadly the XML file was just as incomplete as the iTunes library file. After the last MacOS “upgrade” iTunes lost about 400 of my 9000 songs. I noticed a few complete albums missing, but would have needed hours to figure out exactly which songs were mysteriously gone so I tried a complete library rebuild. At first glance it appears to have worked, but now all my home videos are missing.

    Like others here I keep the actual music and video files on an external HD because they consume 500GB.

    Now it appears that I cannot sort my song list the way I used to either and I hear that the classic song list view has been removed from the new Music app in Catalina. How nice of Apple to remove the only view I use. I’ll bet there’s no other music app that can stream to my Apple TV either. I’m really hating Apple right now.

    • You need to have a good XML file. I always have mine backed up to Time Machine, so if need be, I can restore it. (Or the .itl file.)

      The music and video files will remain on the external drive; only podcasts and audiobooks are “forcibly” moved.

    • You mean the artwork folder? Certainly. But if you’re having problems with artwork, that might not resolve them.

  43. I was having problems with songs skipping to the end prematurely and this solves the issue however I order my library by ‘date added’ so this method isn’t going to work for me. is there any way to generate a new ITL but maintain the date added?

Leave a Reply to James Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.