How to restore iTunes from previous itl file(s)

So after moving iTunes from macs to external drives and a NAS I had music files duplicated and EVERYWHERE. I thought I was being smart and tried to consolidate them in one place after backing up the itl file.

That in hindsight was a bad idea. Now I can't get my itunes to recognize anything.

I have all sorts of ITL backup files and have tried opening iTunes with those, some work but I still get loads of ! in front of music that I have.

My question really is, can I create iTunes on my mac mini that I deleted everthing off of, using the iTunes folder from a different mac? If so, HOW do I get it to find all the files?

I'd love to just start from scratch but I have around 500gb of music and would REALLY like to preserve the playlists and imported dates/plays/stars etc that I already had in previous libraries.

I have all the music, I have many, many ITL files from previous libraries I just need them all the consolidate in one place with all the info?

Is this even possible?

Mac mini, macOS 10.13

Posted on Dec 12, 2021 12:18 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 12, 2021 1:46 PM

First take a look at Make a split library portable for some background on the standard layout of the library. If/when you have a split library it is really easy to break the links between the library and the media files. The post below is about repairing those broken links. You cannot merge .itl files, but you can export an XML file of working tracks from one library, and then import that into another. After importing an XML file you can use the advice in Duplicate songs in iTunes - Apple Community to clean up duplicates and consolidate any new content into your primary media folder.




The "missing file" issue with exclamation marks happens if the file is no longer where iTunes or Music expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, one of its parent folders, the drive it lives on has had a name change, or you've moved a non-portable library to a different path (see Make a split library portable for details). It is also possible that iTunes or Music have changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place, or that you've been too aggressive when deleting duplicates at some point.


Select a track with an exclamation mark, use Cmd-I to get Song Info, then click No when asked to try to locate the track. Look on the file tab for the location the library thinks the file should be. Now take a look around your hard drives. Hopefully you can locate the track in question. If a section of your library has simply been moved, a folder renamed, or a drive label has changed, it should be possible to reverse the actions. If the difference between the two paths is an additional Music folder in one path then this is a layout issue. I can explain further if that is the case. If everything is where it is supposed to be try Repair security permissions for iTunes for Mac - Apple Community.


In some cases the library may be able to repair itself if you go through the same steps with Get Info, or when playing a track, but this time click Locate and browse to the lost track. It may then offer to attempt to automatically fix other broken links. Although it says something like "use the same location" I think it expects to find the tracks in the same artist & album layout they were in previously, with one systematic change to the path.


If you want me to try to provide specific advice please post back the following details:

  1. The location of the media folder under iTunes|Music > Preferences > Advanced
  2. The location of a sample missing track shown under Song Info > File > Location that begins file://
  3. The true path to the file whose details you gave in 2



See also FixLinks - an AppleScript to repair broken links in Music - Apple Community.



tt2

Similar questions

27 replies
Question marked as Top-ranking reply

Dec 12, 2021 1:46 PM in response to itsafourletterword

First take a look at Make a split library portable for some background on the standard layout of the library. If/when you have a split library it is really easy to break the links between the library and the media files. The post below is about repairing those broken links. You cannot merge .itl files, but you can export an XML file of working tracks from one library, and then import that into another. After importing an XML file you can use the advice in Duplicate songs in iTunes - Apple Community to clean up duplicates and consolidate any new content into your primary media folder.




The "missing file" issue with exclamation marks happens if the file is no longer where iTunes or Music expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, one of its parent folders, the drive it lives on has had a name change, or you've moved a non-portable library to a different path (see Make a split library portable for details). It is also possible that iTunes or Music have changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place, or that you've been too aggressive when deleting duplicates at some point.


Select a track with an exclamation mark, use Cmd-I to get Song Info, then click No when asked to try to locate the track. Look on the file tab for the location the library thinks the file should be. Now take a look around your hard drives. Hopefully you can locate the track in question. If a section of your library has simply been moved, a folder renamed, or a drive label has changed, it should be possible to reverse the actions. If the difference between the two paths is an additional Music folder in one path then this is a layout issue. I can explain further if that is the case. If everything is where it is supposed to be try Repair security permissions for iTunes for Mac - Apple Community.


In some cases the library may be able to repair itself if you go through the same steps with Get Info, or when playing a track, but this time click Locate and browse to the lost track. It may then offer to attempt to automatically fix other broken links. Although it says something like "use the same location" I think it expects to find the tracks in the same artist & album layout they were in previously, with one systematic change to the path.


If you want me to try to provide specific advice please post back the following details:

  1. The location of the media folder under iTunes|Music > Preferences > Advanced
  2. The location of a sample missing track shown under Song Info > File > Location that begins file://
  3. The true path to the file whose details you gave in 2



See also FixLinks - an AppleScript to repair broken links in Music - Apple Community.



tt2

Jan 5, 2022 11:45 AM in response to itsafourletterword

See Make a split library portable. Your structure looks subtly wrong. iTunes Music looks like a bit like regular iTunes folder, in that it contains iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, iTunes Library.xml and an Album Artwork folder. However other components in there should really be down inside iTunes Media. The iPod Games, Ringtones, and Mobile Applications folders are probably redundant assuming you're running iTunes 12.7 or later, although you might want to keep the backups somewhere just in case.


When the library is in the standard layout you can move the whole folder to a new path and it should just work. If the relationship between the library folder (with the .itl file) and the media folder (will all media content) is wrong then not so much. Sometimes it can be fixed by declaring the new media folder, sometimes not. If you're wanting to use NAS storage you should probably set the media folder to <NAS>/iTunes/iTunes Media and then consolidate to this new path (File > Library > Organize Library > Consolidate Files) rather than manually moving content. You have to manually delete the original files once consolidation has completed.


tt2

Dec 14, 2021 12:58 PM in response to itsafourletterword

iTunes Music is the old name for the iTunes media folder, now normally called iTunes Media. In an old-school (iTunes 8 and earlier) library artist folders typically go directly into the media folder named in preferences. With new libraries it is more usual for them to go into <Media Folder>/Music. If some of your libraries were started pre-2009 then they could easily have inherited a mix of names and settings. Going forward I would recommend you structure the library with the media folder set to <Some path>/iTunes/iTunes Media. That way it is always possible to put the iTunes library files into <Some path>/iTunes and access them there in order to prepare the library to be moved to a new drive.


The FixLinks script, with a minor tweak, can be used to repair broken links in iTunes as long as tracks are at a reasonably iTunes like path such as this: <Target Folder>/<[Album]Artist>/<Album>/[D-][## ]<Name>[ 1].<Ext>


Change these lines:


-- tell application "iTunes" -- Mojave or earlier

tell application "Music" -- Catalina or later


to these:


tell application "iTunes" -- Mojave or earlier

-- tell application "Music" -- Catalina or later



Consolidating creates copies when the source files are outside of the media folder. If you push everything inside your media folder before trying to fix anything then anything you add/repair can be moved to its default location within the media folder without generating a new copy.



tt2

Dec 24, 2021 3:01 AM in response to itsafourletterword

First you should select a small number of tracks that you want to try to fix until you know the process is going to work for you. When the script reports that it has been unsuccessful that information can be useful in working out why it failed, for example you might not have started the search from the correct media folder. Clicking No when you see this prompt stops the reporting so it just fixes the files it can and no longer reports on those it cannot, i.e. a lot less clicking.


As noted previously if you want me to try to provide specific advice please post back the following details:

  1. The location of the media folder under iTunes|Music > Preferences > Advanced
  2. The location of a sample missing track shown under Song Info > File > Location that begins file://
  3. The true path to the file whose details you gave in 2


With these details I can check that you're picking the correct folder for FixLinks to begin its search, and make sure that your media is structured in a way that makes it likely to be successful.


tt2

Dec 27, 2021 5:22 AM in response to itsafourletterword

You left out the file extensions for 2 & 3. The only obvious discrepancy I can see is the missing space in iTunesMedia under 3. Is that a typo, or do you really have it that way? If you do, editing that space in ought to repair a lot of the missing tracks automatically. When using my script you should point it at either ../iTunes( )Media or ../iTunes( )Media/Music. It should be able to locate tracks when they are set out in the standard <Album Artist>/<Album>/[D-]## <Name>.<Ext>, with or without a trailing " 1" or " 2" before the extension. It reads the properties from the library to build the projected path and some alternatives. If it sees the file on one of them it will relink it.


tt2

Dec 27, 2021 2:15 PM in response to itsafourletterword

From the look of things you seem to have leading disc numbers where they're not necessarily implied. Locate this section of the script:


-- add leading disc number if implied

if disc number of aTrack > 1 or disc count of aTrack > 1 then set theFile to (disc number of aTrack as text) & "-" & theFile


And replace with:

-- add leading disc number

set theFile to (disc number of aTrack as text) & "-" & theFile


And see if it performs any better for you.


Or if the disc numbers are actually missing in the library, but set in the file path, you could try this:


-- add leading disc number of 1

set theFile to "1-" & theFile


This would be a temporary patch to fix affect tracks that match that pattern.


tt2


Jan 5, 2022 1:55 PM in response to itsafourletterword

When you select a new media folder and then consolidate the content that is outside the newly designated media folder will be copied into it, and then the reference in the library is updated to point at the new copy. The old file stays in place until you manually delete it. If you import content from outside the media folder when iTunes is set to make copies inside it then you can get duplicates. See Duplicate songs in iTunes - Apple Community for background on duplicates.


tt2

Dec 14, 2021 12:34 PM in response to turingtest2

Thanks for the detailed reply!

The links are super helpful.

I think maybe I need to rewind now and solve the root of the issue first. Somehow going from all the mac/HDs/NAS my iTunes folders have ended up with MULTIPLE copies of my entire library inside. So for example it'll have the following (this is what is on my NAS right now, all my music should be there, between all the folders) -


itunes/itunes music/ music (4041 items)

itunes/music (1366 items)


But in most other instances (and what prompted this) is my libraries have ended up like this -

itunes/itunes music/ music(4041 items)/music(4041 items)

I think the duplication happens when I've gone to "organize library" and/or "consolidate files"


So in an attempt to consolidate everything, I went through all my itunes folders on all devices and cosolidated using Chronosync. Now I have a folder on an external drive with everything.

I also have the likely most complete backup on the NAS I listed above.

Running itunes from that ITL file on the NAS seems to be working as far as play counts/playlists/ratings showing up BUT it can't find any of the music. Everything I click on needs to be located. I've gone in and located a few of the files and said yes to having it locate other missing files but it doesn't seem to be working.


How do I get it to update the location of all the files to be - NAS/music/itunes/itunes music/music

---that's where it all lives now.


HOPING I've explained it well!

Dec 23, 2021 7:40 AM in response to itsafourletterword

Hmm, I copied the script from the user tip page into a new document here and it is working for me.


Edit the script and remove any tabs, or whitespace at the beginning or ends of both of these lines:


-- evaluate artist folder


set theArtist to album artist of aTrack


Make sure there is a carriage return after folder and aTrack then click the hammer tool which will check syntax and reformat the text applying styles, colours, and nesting structures.


tt2

Dec 23, 2021 7:44 PM in response to turingtest2

Ok seems l wasn't using the Script Editor right (never used it before) but I got it to work.


However NOW its going through ALL the missing items and giving me a popup for every single one it can't find. Is there any way to update it to just FIND ones that are there and skip the ones that aren't? This library has 36,000 items, I have no idea how many have broken links or the files aren't going to be found but seems like a potential to be a LOT of clicking "yes" to continue reporting for every single song it can't find?


The amount of broken links in this library is just overwhelming at this point...and even trying to make a playlist of all the not found items has proven pretty impossible as I can't even drag the entire library to a playlist since its so big.

Dec 26, 2021 4:50 PM in response to turingtest2

Thank you for your continuing help with this, I'm so disappointed I made such a mess out of it all.


As noted previously if you want me to try to provide specific advice please post back the following details:

  1. The location of the media folder under iTunes|Music > Preferences > Advanced
  2. The location of a sample missing track shown under Song Info > File > Location that begins file://
  3. The true path to the file whose details you gave in 2


Answers -

  1. /Volumes/music/iTunes/iTunes Media/Music
  2. file:///Volumes/music/iTunes/iTunes Media/Music/Raphael Saadiq/The Way I See It/1-10 Let's Take a Walk
  3. /volumes/music/iTunes/iTunesMedia/Music/Raphael Saadiq/The Way I See It/1-10 Let's Take a Walk


I'm also seeing another issue where there will be multiple copies of the same file, both in itunes and in the music folder.

So for example using the one above there were 3 copies in itunes of Let's Take a Walk. When I looked in song info for the location I would see one linked to Let's Take a Walk, another to Let's Take a Walk 2, and the 3rd pointing to Let's Take a Walk 3.

There was an original and the copies it still didn't find the original when I try to play or run the script. I had to go by hand and reconnect. I think there probably a LOT of dupes like this as well.

Looks like the issue is most of these are searching for Song 2.mp3 and Song.mp3 is what exists in the folder.


Just looked for Prince "Oh Sheila", the entire path is correct EXCEPT the one it can't find in iTunes is looking for "Oh Sheila 2.mp3" and Oh Sheila.mp3" is the only one that exists in the folder.


Guessing this happened when I was trying to consolidate all the files in ONE folder on ONE drive. Ugh.




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.

How to restore iTunes from previous itl file(s)

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