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. Any suggestions for what to do when it’s the XML file that’s corrupt? Mine includes references to files that don’t exist.

    • It still might be better than the .itl file. You might be able to remove those files in iTunes (assuming you can’t now).

  2. Any suggestions for what to do when it’s the XML file that’s corrupt? Mine includes references to files that don’t exist.

    • It still might be better than the .itl file. You might be able to remove those files in iTunes (assuming you can’t now).

  3. I’m currently on iTunes 12.4. Could I rebuild my iTunes library in a lower version of iTunes, say 12.1, without losing all of my ratings, plays etc.?

  4. I’m currently on iTunes 12.4. Could I rebuild my iTunes library in a lower version of iTunes, say 12.1, without losing all of my ratings, plays etc.?

  5. The problem I have is that I don’t have the .xml files. I am migrating to a new Windows machine (7 Pro) and copied my library to external drive then moved it to new PC. I have the .itl file but not the .xml files. And don’t know how to make a new one/find old one.

    Any ideas?

    Thanks!

    • Go to iTunes > Preferences > Advanced, and check Share iTunes XML with other applications. If that’s not checked, then it doesn’t create the XML file.

      Oh, sorry, Windows; I think it’s Tools > Options > Advanced…

      • So late last night I got the XML file back, but I still can’t get my media files to show up in iTunes. iTunes wouldn’t let me point to the regular path, so I had to rename my “My Music” folder to “Music”. Even with the XML and .itl library files where I have iTunes pointing, nothing populates.

  6. The problem I have is that I don’t have the .xml files. I am migrating to a new Windows machine (7 Pro) and copied my library to external drive then moved it to new PC. I have the .itl file but not the .xml files. And don’t know how to make a new one/find old one.

    Any ideas?

    Thanks!

    • Go to iTunes > Preferences > Advanced, and check Share iTunes XML with other applications. If that’s not checked, then it doesn’t create the XML file.

      Oh, sorry, Windows; I think it’s Tools > Options > Advanced…

      • So late last night I got the XML file back, but I still can’t get my media files to show up in iTunes. iTunes wouldn’t let me point to the regular path, so I had to rename my “My Music” folder to “Music”. Even with the XML and .itl library files where I have iTunes pointing, nothing populates.

  7. Hello Kirk! Thanks so much for your article. My issue is that my itunes itl file is from 2008 and I receive this message The file “iTunes Library.itl” cannot be imported because it does not appear to be a valid exported file”. When I open itunes, my music is missing. Can you help?

    • It’s certainly not the .itl file you’re currently using. That file gets updated every time you play something. You need to find the current library file. Search for other .itl files on your computer.

  8. Hello Kirk! Thanks so much for your article. My issue is that my itunes itl file is from 2008 and I receive this message The file “iTunes Library.itl” cannot be imported because it does not appear to be a valid exported file”. When I open itunes, my music is missing. Can you help?

    • It’s certainly not the .itl file you’re currently using. That file gets updated every time you play something. You need to find the current library file. Search for other .itl files on your computer.

  9. I also have no .xml file. (Running El Capitan, iTunes 12.5) Went to Advanced preferences and checked “Share iTunes XML with other applications” and restarted. Sure enough, there’s a .xml file now . . . but it’s a DreamWeaver file! Tried it twice and it keeps coming up that way. A glance at the contents appears to show coding for iTunes songs, but I have no way of knowing if it’s complete.

    Should I try your procedure, moving the DW file to the desktop?

    • It’s not a Dreamweaver file; it’s just that it shows a Dreamweaver icon, because you have that app installed, and it’s seeing an XML file as part of a web project. Follow the instructions regardless of the file’s icon.

  10. I also have no .xml file. (Running El Capitan, iTunes 12.5) Went to Advanced preferences and checked “Share iTunes XML with other applications” and restarted. Sure enough, there’s a .xml file now . . . but it’s a DreamWeaver file! Tried it twice and it keeps coming up that way. A glance at the contents appears to show coding for iTunes songs, but I have no way of knowing if it’s complete.

    Should I try your procedure, moving the DW file to the desktop?

    • It’s not a Dreamweaver file; it’s just that it shows a Dreamweaver icon, because you have that app installed, and it’s seeing an XML file as part of a web project. Follow the instructions regardless of the file’s icon.

  11. Also, iTunes now displays only those songs & albums purchased from the iTunes Store. I know my uploaded CD files are still in the system, because I can call up titles I know. But how do I get them back into my iTunes window?

  12. Also, iTunes now displays only those songs & albums purchased from the iTunes Store. I know my uploaded CD files are still in the system, because I can call up titles I know. But how do I get them back into my iTunes window?

  13. Thanks for the help. All the songs are back. No playlists, unfortunately, but I can gradually rebuild those.

  14. Thanks for the help. All the songs are back. No playlists, unfortunately, but I can gradually rebuild those.

  15. Hi, I followed the instructions for getting rid of shuffle in iTunes 12.5, but after I imported the new xml/itl file, my playlists doubled-up (2 of every playlist). I followed the instructions to the letter, what went wrong? I really want to get rid of this shuffle business1

  16. Hi, I followed the instructions for getting rid of shuffle in iTunes 12.5, but after I imported the new xml/itl file, my playlists doubled-up (2 of every playlist). I followed the instructions to the letter, what went wrong? I really want to get rid of this shuffle business1

  17. I am running itunes 12.1.1.21 on a Macbook with Mavericks OS.
    I want to load some new music from Itunes Store but I can’t for the life of me find how I can Add a Playlist!!!!! Its not down the bottom like it used to be.
    Anyone help out?

  18. I am running itunes 12.1.1.21 on a Macbook with Mavericks OS.
    I want to load some new music from Itunes Store but I can’t for the life of me find how I can Add a Playlist!!!!! Its not down the bottom like it used to be.
    Anyone help out?

  19. After doing this rebuild with iTunes 12.4.0.119, the star ratings for thousands of tracks are gray and can’t be changed.
    Only about a hundred tracks out of nearly 20,000 have black stars.
    This is unacceptable and there’s no way I’m going to lose years of ratings.
    I’ll now have to replace the old file and find another way to squash the bug in my library.

    That file BTW, is now just named “iTunes Library” with no extension, not “iTunes Library.itl” as shown above.

    All the podcasts were restored in the Music tab, not in Podcasts. I had to select them and change “Options>media kind” back to Podcast.

  20. After doing this rebuild with iTunes 12.4.0.119, the star ratings for thousands of tracks are gray and can’t be changed.
    Only about a hundred tracks out of nearly 20,000 have black stars.
    This is unacceptable and there’s no way I’m going to lose years of ratings.
    I’ll now have to replace the old file and find another way to squash the bug in my library.

    That file BTW, is now just named “iTunes Library” with no extension, not “iTunes Library.itl” as shown above.

    All the podcasts were restored in the Music tab, not in Podcasts. I had to select them and change “Options>media kind” back to Podcast.

  21. We’re in the process of switching from a Thunderbolt external drive to a USB external drive (Thunderbolt keeps disconnecting from laptop…are all Thunderbolt cables junk or have we just been unlucky?).

    The directory for the iTunes is probably messed up because of constant ejections of the Thunderbolt drive. The boxes are clicked to keep a copy of files in the Media Folder, but when I move the iTunes folder to the new drive and open iTunes (pointing it to the new location) all of the songs are exclamation points. The library will not consolidate down.

    We are now trying the method above. The first time I started this it worked perfectly, except I forgot to tell iTunes to put the new library on the external drive. After about 35,000 songs it ran out of room on the laptop. I cancelled the process, deleted the new files, quit iTunes and started over. This time I pointed it to the external drive.

    It has been saying “Importing Playlist” for about 2 hours, but there is no change that I can see happening. Should I trust it is doing something in the background or cancel again and restart? There is about 5TB of music, so I don’t expect this to happen quickly. The first time it at least showed a progress bar.

    • 5 TB of music is going to take a very long time. Is this USB 2 or USB 3? The former could take more than 24 hours; the latter, maybe 6- 10 hours.

  22. We’re in the process of switching from a Thunderbolt external drive to a USB external drive (Thunderbolt keeps disconnecting from laptop…are all Thunderbolt cables junk or have we just been unlucky?).

    The directory for the iTunes is probably messed up because of constant ejections of the Thunderbolt drive. The boxes are clicked to keep a copy of files in the Media Folder, but when I move the iTunes folder to the new drive and open iTunes (pointing it to the new location) all of the songs are exclamation points. The library will not consolidate down.

    We are now trying the method above. The first time I started this it worked perfectly, except I forgot to tell iTunes to put the new library on the external drive. After about 35,000 songs it ran out of room on the laptop. I cancelled the process, deleted the new files, quit iTunes and started over. This time I pointed it to the external drive.

    It has been saying “Importing Playlist” for about 2 hours, but there is no change that I can see happening. Should I trust it is doing something in the background or cancel again and restart? There is about 5TB of music, so I don’t expect this to happen quickly. The first time it at least showed a progress bar.

    • 5 TB of music is going to take a very long time. Is this USB 2 or USB 3? The former could take more than 24 hours; the latter, maybe 6- 10 hours.

  23. It is USB 3.0. iTunes said an unknown error occurred (~50) and stopped importing after 1TB. We quit and tried again same thing almost instantly. Any suggestions?

    We could try doing all of this with a rebuild on the Thunderbolt drive and not move the laptop if that will make the import faster and better. We would prefer to use the Thunderbolt drive, but the cables all seem to be incredibly sensitive and only work for a few days. We’re not being rough with them, just moving a laptop from table to lap and back.

    • Hmm, that’s odd. iTunes may have problems reading the disk. Maybe you should run a disk check with Disk Utility.

  24. It is USB 3.0. iTunes said an unknown error occurred (~50) and stopped importing after 1TB. We quit and tried again same thing almost instantly. Any suggestions?

    We could try doing all of this with a rebuild on the Thunderbolt drive and not move the laptop if that will make the import faster and better. We would prefer to use the Thunderbolt drive, but the cables all seem to be incredibly sensitive and only work for a few days. We’re not being rough with them, just moving a laptop from table to lap and back.

    • Hmm, that’s odd. iTunes may have problems reading the disk. Maybe you should run a disk check with Disk Utility.

  25. Hi Kirk; is this procedure still current? I tried it and now iTunes is not showing much album art, no Apps, no Tones, no Audiobooks. I have all that content in folders of those names in the iTunes folder.
    Is there a nuclear option? ie take everything out of the Music > iTunes folder, relaunch iTunes, then drag each folder back in?
    I’m only trying this since I’ve purchased albums in iTunes last few days and they did not properly download, were indicated as corrupt, yet still showed up in iTunes despite right-click delete from Library as well as dragging the music’s folder in Finder to the trash and emptying, quitting app, rebooting mac etc. That and other long term general wonkiness with books also.
    Would not mind a fresh new start.
    Many Thanks, dave

    • Sounds like you do need the nuclear option. Delete everything from iTunes, but don’t move the files to the trash. (And perhaps make a backup of your iTunes Media folder first.) Then drag the iTunes Media folder onto iTunes, and it will load everything. You’ll lose metadata such as play counts and ratings, and you’ll lose your playlists though.

  26. Hi Kirk; is this procedure still current? I tried it and now iTunes is not showing much album art, no Apps, no Tones, no Audiobooks. I have all that content in folders of those names in the iTunes folder.
    Is there a nuclear option? ie take everything out of the Music > iTunes folder, relaunch iTunes, then drag each folder back in?
    I’m only trying this since I’ve purchased albums in iTunes last few days and they did not properly download, were indicated as corrupt, yet still showed up in iTunes despite right-click delete from Library as well as dragging the music’s folder in Finder to the trash and emptying, quitting app, rebooting mac etc. That and other long term general wonkiness with books also.
    Would not mind a fresh new start.
    Many Thanks, dave

    • Sounds like you do need the nuclear option. Delete everything from iTunes, but don’t move the files to the trash. (And perhaps make a backup of your iTunes Media folder first.) Then drag the iTunes Media folder onto iTunes, and it will load everything. You’ll lose metadata such as play counts and ratings, and you’ll lose your playlists though.

  27. Thanks for the quick reply Kirk; is there any way to preserve and reinstall the playlists? I’ve developed them over many years since first using iTunes when it came out, some have sentimental value, others I wouldn’t be able to recreate from memory…
    Counts and ratings are no big deal for me.

    • The XML file contains that stuff. Maybe try again.

      If it’s only certain types of media that aren’t showing, you can drag their folders onto iTunes to add them.

      • Hi Kirk; Ok, so I went ahead and made backup copies first, then removed all the content folders from the iTunes folder. Updated iTunes. launched and told it to import the .xml playlist file, then added content folders back into the iTunes folder.
        Moved Books folder out, found the iBooks books folder, deleted its contents, opened iBooks and imported all the Books folder contents, and now both iTunes and iBooks seem to better represent my content.
        The only glitch I’ve seen now is that iTunes Music, in Albums view, includes my Podcasts.
        So I’m starting to delete those from the Albums view.
        Might find other glitches going forward, and am still to worried this has actually worked until I reboot, then I may try syncing iPhone and iPad and resuming normal ops.
        Filed an inquiry with Apple about problems with an album download, for the second time. First time they did not respond within 48h as promised.
        Anyway, that’s the update, thanks for the help, content seems to be there and the playlists so far so good!

        • Hey Kirk; another follow up. iTunes is really getting wacky. ‘Recently Played’ smartlist was not showing recently played items. iPhone says it is not syncing Music, yet Audio is the largest chunk of storage use. There are unremovable videos, music I don’t recall adding, that is not music I’m interested in, etc. Really lots more goofed up things.
          What I’d like to do is preserve the playlists and recreate them after nuking the library.
          What’s the easiest workflow for that? export individual playlists as xml, or text, then refer to that when creating them in the fresh iTunes? or export the whole library of playlists?
          It’s going to take hours and hours but I’m really frustrated with the mess and realize it needs to be done, a bit each day…

          dave

  28. Thanks for the quick reply Kirk; is there any way to preserve and reinstall the playlists? I’ve developed them over many years since first using iTunes when it came out, some have sentimental value, others I wouldn’t be able to recreate from memory…
    Counts and ratings are no big deal for me.

    • The XML file contains that stuff. Maybe try again.

      If it’s only certain types of media that aren’t showing, you can drag their folders onto iTunes to add them.

      • Hi Kirk; Ok, so I went ahead and made backup copies first, then removed all the content folders from the iTunes folder. Updated iTunes. launched and told it to import the .xml playlist file, then added content folders back into the iTunes folder.
        Moved Books folder out, found the iBooks books folder, deleted its contents, opened iBooks and imported all the Books folder contents, and now both iTunes and iBooks seem to better represent my content.
        The only glitch I’ve seen now is that iTunes Music, in Albums view, includes my Podcasts.
        So I’m starting to delete those from the Albums view.
        Might find other glitches going forward, and am still to worried this has actually worked until I reboot, then I may try syncing iPhone and iPad and resuming normal ops.
        Filed an inquiry with Apple about problems with an album download, for the second time. First time they did not respond within 48h as promised.
        Anyway, that’s the update, thanks for the help, content seems to be there and the playlists so far so good!

        • Hey Kirk; another follow up. iTunes is really getting wacky. ‘Recently Played’ smartlist was not showing recently played items. iPhone says it is not syncing Music, yet Audio is the largest chunk of storage use. There are unremovable videos, music I don’t recall adding, that is not music I’m interested in, etc. Really lots more goofed up things.
          What I’d like to do is preserve the playlists and recreate them after nuking the library.
          What’s the easiest workflow for that? export individual playlists as xml, or text, then refer to that when creating them in the fresh iTunes? or export the whole library of playlists?
          It’s going to take hours and hours but I’m really frustrated with the mess and realize it needs to be done, a bit each day…

          dave

  29. Hi Kirk;
    That last rebuild didn’t solve issues.
    Today I exported all the playlists I want to keep and took all the files out of Music > iTunes and deleted iTunes folder. Went into my account folder and deleted a bunch of iTunes related files. Tried to delete the iTunes app but got a warning that it’s required by MacOS.
    Launched iTunes again and it created a new iTunes folder and… decided I have 174 albums in my library. Although there are none in the iTunes folder and my Library and itl and xml files are moved to another folder and it should be looking at a brand new fresh and empty itunes folder.
    Wot the hey? I am really sick of this and would like to nuke/delete iTunes and all its associated files, re-download it and manually drag in all the content that I moved out a little while ago and then start bringing in the playlist xmls.
    I have the feeling that is the only way to get it to behave correctly again. Everything else I’ve tried still leaves iTunes with plenty of flaws. Enough that I don’t want to update any iOS apps, buy anything, or even sync my phones/ipad with it. (iCloud sync of those is out of the question).
    aiiieee!

    • Are the 174 albums in the library purchased from the iTunes Store? By default, iTunes shows all your purchases when you create a library.

  30. Hi Kirk;
    That last rebuild didn’t solve issues.
    Today I exported all the playlists I want to keep and took all the files out of Music > iTunes and deleted iTunes folder. Went into my account folder and deleted a bunch of iTunes related files. Tried to delete the iTunes app but got a warning that it’s required by MacOS.
    Launched iTunes again and it created a new iTunes folder and… decided I have 174 albums in my library. Although there are none in the iTunes folder and my Library and itl and xml files are moved to another folder and it should be looking at a brand new fresh and empty itunes folder.
    Wot the hey? I am really sick of this and would like to nuke/delete iTunes and all its associated files, re-download it and manually drag in all the content that I moved out a little while ago and then start bringing in the playlist xmls.
    I have the feeling that is the only way to get it to behave correctly again. Everything else I’ve tried still leaves iTunes with plenty of flaws. Enough that I don’t want to update any iOS apps, buy anything, or even sync my phones/ipad with it. (iCloud sync of those is out of the question).
    aiiieee!

    • Are the 174 albums in the library purchased from the iTunes Store? By default, iTunes shows all your purchases when you create a library.

  31. Many Thanks Kirk! Good thought… but, uh… hm…
    Account > Purchased doesn’t give a count… there is a long list on the left and only a few “Recent” albums. No apparent way to get a count of all. “Recent” Songs, scrolling to bottom, is 250.
    iTunes Library > Albums, View > Only Downloaded Music shows No items in Grid or List view.
    Switching to View > All Music and View as Grid shows the 174, consuming 7.62 GB in Status Bar.
    Switching to View as List shows 981 items in Status Bar.
    It’s possible they are all purchases but at least a dozen I don’t recall purchasing and wouldn’t initially have any interest in based on the artists. Some are full albums, some only a single track, although Albums is selected in the Library source section.
    Which all reminds me, what the hey is “downloaded” music? from where to where? When i connect my iDevices to sync, the music is… downloaded to the device from the Mac. Or do they mean downloaded from iTunes? if so why isn’t it called ‘purchased’ (even though some may have not cost anything).
    Anyway, bottom line is, if you think something is still fouled up or if it is safe to start dragging my music etc back into the iTunes folder?

    • Right. View > All Music is the music in the cloud. So that’s either purchased music, or music in an iCloud Music Library.

  32. Many Thanks Kirk! Good thought… but, uh… hm…
    Account > Purchased doesn’t give a count… there is a long list on the left and only a few “Recent” albums. No apparent way to get a count of all. “Recent” Songs, scrolling to bottom, is 250.
    iTunes Library > Albums, View > Only Downloaded Music shows No items in Grid or List view.
    Switching to View > All Music and View as Grid shows the 174, consuming 7.62 GB in Status Bar.
    Switching to View as List shows 981 items in Status Bar.
    It’s possible they are all purchases but at least a dozen I don’t recall purchasing and wouldn’t initially have any interest in based on the artists. Some are full albums, some only a single track, although Albums is selected in the Library source section.
    Which all reminds me, what the hey is “downloaded” music? from where to where? When i connect my iDevices to sync, the music is… downloaded to the device from the Mac. Or do they mean downloaded from iTunes? if so why isn’t it called ‘purchased’ (even though some may have not cost anything).
    Anyway, bottom line is, if you think something is still fouled up or if it is safe to start dragging my music etc back into the iTunes folder?

    • Right. View > All Music is the music in the cloud. So that’s either purchased music, or music in an iCloud Music Library.

  33. PS–I just looked at the iTunes Media > Podcasts folder (the new one generated after moving everything out) and there is one episode of one podcast in there, but it doesn’t show in the Podcasts in iTunes itself. It is one of a few I subscribe to but… I removed everything from iTunes Media folder the other day. How did this one get there? if iTunes put it there why wouldn’t it show in iTunes itself?
    Arg arg arg. I just want to purge this thing.
    Maybe I need to go through this whole process again but first sign out of my account in itunes and disconnect from the internet…

  34. PS–I just looked at the iTunes Media > Podcasts folder (the new one generated after moving everything out) and there is one episode of one podcast in there, but it doesn’t show in the Podcasts in iTunes itself. It is one of a few I subscribe to but… I removed everything from iTunes Media folder the other day. How did this one get there? if iTunes put it there why wouldn’t it show in iTunes itself?
    Arg arg arg. I just want to purge this thing.
    Maybe I need to go through this whole process again but first sign out of my account in itunes and disconnect from the internet…

  35. Can iTunes 12 build a consolidated Media Folder after the fact?
    Hello, this question is a little different than it sounds. I am current on iTunes 12.6, and have just moved all my Music & iTunes DB’s onto a Synology NAS drive. However when I did this I DID NOT check the advanced preferences: Keep Media folder organized, nor Copy files to iTunes Media folder when adding to library. As a result, iTunes put nothing in the iTunes Media Folder location specified in Advanced preferences. But I did follow your advice and checked the box to share iTunes Library XML with other locations. I built the Synology version of iTunes using the iTunes Media Folder from my old computer as input via Add Folder to iTunes Library to an empty version of iTunes I created new on Synology.

    I just completed a fair amount of rationalization, finding missing songs and albums and letting iTunes know where the music & artwork for each album is located (same folder as the album music). So instead of having a complete set of organized and rationalized media within the iTunes Media folder I guess it’s all buried within an iTunes DB somewhere. I have about 500 artists and my old media folder is about 150gb, so not an easy or quick process to rebuild and rationalize everything a second time.

    Is there a way to have iTunes completely build a complete version of the iTunes media folder from scratch since it has all the information in its databases with a pointer to the physical location of every song, and each bit of artwork. For instance, if I now changed the advanced preferences and checked those boxes would iTunes only manage and copy music for any new music I added from this point forward or would/could it build the entire iTunes Media Folder ?

    Thank you! Fred

    • File > Library > Organize Library, then Consolidate Files should move the files to the correct location.

      However, if you’ve moved files after moving the folders onto the NAS, it might not find everything, and those files you moved may be orphaned.

      • Kirk, thank you for the quick reply & yes the good news is that all the files are in their original locations, none of the original files have been moved, or modified in any way so hopefully no orphans.

        Two points of clarification, please:
        1) Should I change the Advanced Preferences to select: ‘Keep Media Folder organized’ & ‘Copy files to Media Folder when adding’ prior to: File > Library > Organize Library, then Consolidate Files?
        2) After Consolidate Files is complete – the newly created Media Folder will then contain all data pointed to by the various iTunes Library data bases and Playlists. Meaning, I can then remove the original files used prior to consolidation (after validating the consolidate did indeed work correctly and completely – in case I need to do the consolidate a second or even third time)?

        Thanks again.

        • Yes, you should definitely set those options so iTunes moves your files to the correct folders. I don’t think you’d need to do it more than once, but do back everything up just in case something doesn’t get moved.

  36. Can iTunes 12 build a consolidated Media Folder after the fact?
    Hello, this question is a little different than it sounds. I am current on iTunes 12.6, and have just moved all my Music & iTunes DB’s onto a Synology NAS drive. However when I did this I DID NOT check the advanced preferences: Keep Media folder organized, nor Copy files to iTunes Media folder when adding to library. As a result, iTunes put nothing in the iTunes Media Folder location specified in Advanced preferences. But I did follow your advice and checked the box to share iTunes Library XML with other locations. I built the Synology version of iTunes using the iTunes Media Folder from my old computer as input via Add Folder to iTunes Library to an empty version of iTunes I created new on Synology.

    I just completed a fair amount of rationalization, finding missing songs and albums and letting iTunes know where the music & artwork for each album is located (same folder as the album music). So instead of having a complete set of organized and rationalized media within the iTunes Media folder I guess it’s all buried within an iTunes DB somewhere. I have about 500 artists and my old media folder is about 150gb, so not an easy or quick process to rebuild and rationalize everything a second time.

    Is there a way to have iTunes completely build a complete version of the iTunes media folder from scratch since it has all the information in its databases with a pointer to the physical location of every song, and each bit of artwork. For instance, if I now changed the advanced preferences and checked those boxes would iTunes only manage and copy music for any new music I added from this point forward or would/could it build the entire iTunes Media Folder ?

    Thank you! Fred

    • File > Library > Organize Library, then Consolidate Files should move the files to the correct location.

      However, if you’ve moved files after moving the folders onto the NAS, it might not find everything, and those files you moved may be orphaned.

      • Kirk, thank you for the quick reply & yes the good news is that all the files are in their original locations, none of the original files have been moved, or modified in any way so hopefully no orphans.

        Two points of clarification, please:
        1) Should I change the Advanced Preferences to select: ‘Keep Media Folder organized’ & ‘Copy files to Media Folder when adding’ prior to: File > Library > Organize Library, then Consolidate Files?
        2) After Consolidate Files is complete – the newly created Media Folder will then contain all data pointed to by the various iTunes Library data bases and Playlists. Meaning, I can then remove the original files used prior to consolidation (after validating the consolidate did indeed work correctly and completely – in case I need to do the consolidate a second or even third time)?

        Thanks again.

        • Yes, you should definitely set those options so iTunes moves your files to the correct folders. I don’t think you’d need to do it more than once, but do back everything up just in case something doesn’t get moved.

  37. Followed this How-To article and it appeared to work OK, except, I now have 2 of every Playlist in iTunes – both Custom Playlists and iTunes own automatic Playlists, e.g. Recently Added, Recently Played, My Top Rated, etc…! What’s happened there???

    • It sounds like you didn’t start with a completely empty library before we building. You can just delete all the duplicate playlists.

  38. Followed this How-To article and it appeared to work OK, except, I now have 2 of every Playlist in iTunes – both Custom Playlists and iTunes own automatic Playlists, e.g. Recently Added, Recently Played, My Top Rated, etc…! What’s happened there???

    • It sounds like you didn’t start with a completely empty library before we building. You can just delete all the duplicate playlists.

  39. Am I the only one who cares about the “date added” information? For me, my library becomes like a history of my life going back 15 years, sorting by date added. I would REALLY hate to lose that data.

    From what I’ve been able to figure out, the date added info is readable in AppleScript, but it’s not writeable. So Doug’s AppleScripts is not likely to have a solution soon.

    I’m hoping that there may be some kind of kludge solution.

    Argh.

  40. Am I the only one who cares about the “date added” information? For me, my library becomes like a history of my life going back 15 years, sorting by date added. I would REALLY hate to lose that data.

    From what I’ve been able to figure out, the date added info is readable in AppleScript, but it’s not writeable. So Doug’s AppleScripts is not likely to have a solution soon.

    I’m hoping that there may be some kind of kludge solution.

    Argh.

  41. Am I the only one concerned about preserving date added information? Normally, that gets nuked anytime you rebuild the library from XML. Any ideas?

    • I find it a nice to have but I won’t be too broken up if I lose it. More important that I can access my entire library and play counts, last played, ratings etc maintained.

  42. Am I the only one concerned about preserving date added information? Normally, that gets nuked anytime you rebuild the library from XML. Any ideas?

    • I find it a nice to have but I won’t be too broken up if I lose it. More important that I can access my entire library and play counts, last played, ratings etc maintained.

  43. Wow! This is a very popular (and very helpful) blog. Thanks for this! Unfortunately, I’m having a slight problem. I grabbed an iTunes Library file (no XML because I didn’t have that option turned on before iTunes crashed on me and created the “damaged” iTunes Library file) from an online backup and am trying to import it, but iTunes keeps saying: The file “iTunes Library.itl” cannot be imported because it does not appear to be a valid exported file. Any thoughts on how to deal with this situation would be greatly appreciated! It’s probably worth noting that my iTunes Music folder is 800GB or so. Thanks again for the helpful blog (and amazing response to commenters as well)!

  44. Wow! This is a very popular (and very helpful) blog. Thanks for this! Unfortunately, I’m having a slight problem. I grabbed an iTunes Library file (no XML because I didn’t have that option turned on before iTunes crashed on me and created the “damaged” iTunes Library file) from an online backup and am trying to import it, but iTunes keeps saying: The file “iTunes Library.itl” cannot be imported because it does not appear to be a valid exported file. Any thoughts on how to deal with this situation would be greatly appreciated! It’s probably worth noting that my iTunes Music folder is 800GB or so. Thanks again for the helpful blog (and amazing response to commenters as well)!

  45. Hi Kirk, i made problems for my self. Before the problem i had i tunes playlists on left column. itunes library was on my computer and mp3 files located on external drive. mp3’s was dragged and dropped to playlists and there was no copys made by itunes on itunes media/audio folder.

    Now i changed new external drive, moved my files and itunes can’t locate the mp3’s. I have copy of previous itunes folder, containing my playlists and all, but when i get the file info, path is wrong. There is no help to change path from itunes advanced settings window and update the library, or try to make itunes make copy of the playlist files, because it’s not working. I can’t rebuild the library.

    Is there some work around to make it possible to itunes scan new external hdd and find the files and they path. My mp’s are many different folders, sorted by example: computer 1/mp3/artist name/record title
    computer 2/mp3/artist name/record title
    computer 3/mp3/artist name/record title

  46. Hi Kirk, i made problems for my self. Before the problem i had i tunes playlists on left column. itunes library was on my computer and mp3 files located on external drive. mp3’s was dragged and dropped to playlists and there was no copys made by itunes on itunes media/audio folder.

    Now i changed new external drive, moved my files and itunes can’t locate the mp3’s. I have copy of previous itunes folder, containing my playlists and all, but when i get the file info, path is wrong. There is no help to change path from itunes advanced settings window and update the library, or try to make itunes make copy of the playlist files, because it’s not working. I can’t rebuild the library.

    Is there some work around to make it possible to itunes scan new external hdd and find the files and they path. My mp’s are many different folders, sorted by example: computer 1/mp3/artist name/record title
    computer 2/mp3/artist name/record title
    computer 3/mp3/artist name/record title

Leave a Reply

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