A LOT of iTunes broken links/tracks after Music folder move...

So yeah, I'm getting a TON of broken links / dead track links in iTunes after having to do two things to my iTunes install recently and I'm at wits end trying to fix it.
I keep my iTunes Music Folder on an external and share the iTunes library between my work Macbook Pro and my home Macbook. Every Friday I drag my iTunes folder and all contents from my MBP onto an external and replace the iTunes folder on the 'weekend' MB, then do the same back on Monday. I keep my iTunes music 'View' as 'Date Added' so that I can always be listening to whatever is newest. It's how I roll.
Well, this week I had some data problems during the transfer and had to use a previous week's iTunes Music Folder, which was fine as I hadn't added much this week.
I also got a new external because the old one was getting a little shady, so after doing the iTunes Music Folder replacement I moved my music all over to a new external drive, told iTunes where it all was at. iTunes did it's thing, 'organized' my stuff and all seemed good - until I got back deeper into the catalogue of music and started getting a LOT of broken tracks. The songs are still there, in the correct folders and all, but for some reason iTunes isn't finding them.
When I say a LOT, I mean so far it's hundreds of my 13,000 songs.
Now I COULD use the 'Super Remove Dead Tracks' script from Doug's to find all the broken files then re-add the whole library, but it will add all the old songs out of order because they will get a new 'Added' date.
I could also manually move thru my whole library holding down the arrow key for 'Next' to find all the broken links then go thru, select them, and use the 'iTunes Track CPR' script from Doug's to re-add them to the library with ratings intact, but still they will be out of order time-wise.
I cannot find a script that will parse my library, find broken links, and re-associate them with their tracks, nor can I figure out why this happened and any other way to fix it. Repairing permissions hasn't helped. Any other ideas?

Just to follow up with a more comprehensive example of looping through a Library to detect & repair "missing" file-tracks:
<pre>
property kErrAENoSuchObject:(-1728)
on run
tell (application "iTunes")
set theLibraryPlaylist to (first library playlist)
tell theLibraryPlaylist
set theNumCandidateFileTracks to (count (every file track))
repeat with i from 1 to theNumCandidateFileTracks by 1
-- Get a reference to this file-track
set thisFileTrackRef to (file track i)
-- Get this file-track's info (useful for debugging, etc.)
set thisArtist to (artist of thisFileTrackRef)
set thisAlbum to (album of thisFileTrackRef)
set thisName to (name of thisFileTrackRef)
set thisFileTrackInfo to (thisArtist & " > " & thisAlbum & " > " & thisName)
-- Display a diagnostic message every 500th file-track
if ((i mod 500) = 0) then
tell me
display dialog ("Checking file-track #" & i & ": " & ¬
return & return & thisFileTrackInfo) ¬
buttons {"Cancel", "•"} giving up after 2.5
end tell -- me
end if
-- Retrieve this file-track's target file (an AS 'alias' object), if any
-- {!!! NOTE: Due to a bug in iTunes 7.x+ (esp. when downloading), AS might
-- be unable to access the 'location' field of some file-tracks !!!}
try
set thisFileTrackTargetFile to (location of thisFileTrackRef)
on error errMsg2 number errNum2
-- Check whether it's that bizarre error: (-1728) "Can't get location of …"
if (errNum2 = (kErrAENoSuchObject of me)) then
-- Set up to just skip this track (assume it's being downloaded)
set thisFileTrackTargetFile to (anything) -- (Other than 'missing value')
else (* Re-signal all other errors *)
error errMsg2 number errNum2
end if
end try
-- Check whether this file-track is "missing" its target file
if (thisFileTrackTargetFile = (missing value))
-- Inform the user
tell me
display dialog ("Repairing this missing file-track: " & ¬
return & return & thisFileTrackInfo) ¬
buttons {"Cancel", "•"} giving up after 2.5
end tell -- me
-- Set up this target file's new pathname (e.g., via explicit user input, or
-- better yet automatically reconstructed from this file-track's tags such
-- as Artist, Album, Name, Kind, etc.)
-- ... Translate this file-track's kind into a filename-extension
set thisKind to (kind of thisFileTrackRef)
set thisNameExt to "m4a" -- ... Default
if ({thisKind} is in {("Protected AAC audio file")}) then -- Older DRM'd file
set thisNameExt to "m4p"
else if ({thisKind} is in {("MPEG audio file")}) then -- MP3
set thisNameExt to "mp3"
else if (thisKind contains "movie file") then -- E.g., interactive booklet
set thisNameExt to "mov"
end -- (thisKind = "MPEG audio file") ... else if ... else ...
-- ... Auto-build this target file's new pathname
set thisTargetFileNewPathname to ("New Disk:New Path:" & ¬
thisArtist & ":" & thisAlbum & ":" & thisName & "." & thisNameExt)
-- Assign this new target file (as an AS 'alias' object) to this file-track
-- (This is the crucial step that was impossible in older versions of iTunes!)
set (location of thisFileTrackRef) to (alias thisTargetFileNewPathname)
end if -- (thisFileTrackTargetFile = (missing value))
end repeat -- with i from 1 to theNumCandidateFileTracks by 1
end tell -- theLibraryPlaylist
end tell -- (application "iTunes")
end run
</pre>
Regards,
--P

Similar Messages

  • After a crash, lots of audiobooks have somehow moved to Music folder, and links are broken - how can I fix this?

    Wow, I'm surprised the forums accepted that long a title.
    Anyway, the computer crashed. I started again, and when opening iTunes after the crash ... something happened. There was a prompt that I idiotically didn't write down (Moving Library? Updating Library?), that kept going for hours, and eventually I just gave up and shut it down. That was probably stupid. Also evidence of significant things happening: the next Time Machine backup was 60GB+, so something big had changed.
    As best I can tell, lots of my Audiobooks (and I've got MANY) now have broken links - when I look in the "iTunes Media" folder, many of the files that were once in the "Audiobooks" folder are now in the "Music" folder instead. All are still in the same subfolder as before: so audiobook files that were in "Audiobooks / BBC Melvyn Bragg" are now in "Music / BBC Melvyn Bragg", for example. So far I've only found Audiobooks that have been messed up in this way. Music and iTunes U and Podcasts seem to be unchanged, but maybe I just haven't noticed those problems yet.
    And obviously I want to fix this.
    Note that my iTunes library is set to "Keep iTunes Music Folder organized". All of the organization is what iTunes has done.
    Option 1: can I just restore from a Time Machine backup? If so, what should I restore? There have been a few changes in the metadata in the 3-4 days since the crash, but I'm not overly concerned with that.
    Option 2: can I just use Finder and move the files back? This would seem the "easiest" option to me. Although lots (hundreds? thousands?) of audiobook files have been moved, they're within only a couple of dozen different folders. Dragging them back into the correct folder would be easy - but what kind of havoc would that wreak on the database system?
    Option 3: go through each track and find the file. I can do this. It'll take hours and hours and hours. I don't want to do this.
    Slightly different question: how can I make a smart playlist of all the files with broken links? (I'm still trying to get a handle on just how big this problem is.) I've found suggestions about (1) making a smart playlist of everything, (2) dragging all of those into a normal playlist, and (3) making a new smart playlist of whatever's in #1 but not in #2, but that doesn't seem to be working for this situation. Is that advice now outdated, or is there something unique to my situation?
    Thanks in advance!

    Following up: I went with Option 2 above, and it seems to have worked quite well. I didn't even need to quit iTunes. After the files were moved, the exclamation marks remained at first, until I played the file, or restarted iTunes - now all seems well, until the next crash anyway.

  • How do I get iTunes to link to the music in a new location?

    OK, so right before the hard drive where all my music files originally were located, died, I backed up all my music files the prescribed way via the iTunes support article to a different, external hard drive. I then option-opened iTunes to select the new iTunes music media folder location, no problem.
    BUT - when I click on any of my music titles, iTunes says the file "could not be used because it could not be found. Would you like to locate it?" I have close to 300GB worth of music files. It would be a pain to "re-link" every file one by one. How else can I do this???
    I apologize if this has been answered before, but I searched for a while and could not find the exact same problem. Thanks, in advance, for any help.
    Signed - an Apple computer user since 1982, Gojirasan.
    Message was edited by: gojirasan

    gojirasan wrote:
    I backed up all my music files the prescribed way via the iTunes support article to a different, external hard drive.
    i'm guessing you mean this article: http://support.apple.com/kb/HT1751.
    unfortunately, this will only backup your media files but not the heart of your library, the iTunes library file. in the library file, location of the media files, playcounts, ratings, etc. are stored.
    How else can I do this???
    unless you have a copy of said iTunes library file, the only option i can think of is this script:
    _*iTunes Track CPR v1.3*_
    This script attempts to locate the files of so-called "dead tracks"--iTunes tracks designated with (!)--that you assume are not actually missing but are still located in the iTunes Music folder in their "iTunes File Order" (Music -> Artist -> Album -> file.xxx)."
    JGG

  • After moving the library, itunes shows less songs than music folder in finder does

         hi all.
    after moving my library manually, i have this situation:
    1220 songs in music folder;
    1091 songs in itunes.
    all the songs in itunes are regularly matched with the original file in the finder.
    now. how to find the 29 files which are not in itunes? i don't care why this happened !!
    thanks to all in advance

    in my itunes media folder there are not audio files! they are stored in music folder of the macintosh hd, as you can see from these screenshots. do you have any suggestion?

  • How to ensure the link between iTunes Library itl file and Music Folder residing on a different drive?

    I'm planning to move my Music Library from a PC to Mac.  Both running iTunes 10.  
    On the PC (Win XP) the iTues folder did not move from My Music folder when music (and videos, books, etc) were moved to a different drive on the PC.  iTunes runs ok, but the itl, xml and itdb files remain in the My Music Folder.
    When I transfer the music (folder and all other contents) to the Mac, and then the itl, xml, itdb files into the new Music>iTunes folder will they still be "linked" or will I need to rebuild the itl from scratch?
    Is there a way to ensure that the itl and music files themselves transfer to the Mac and remain linked once iTunes is launched?
    thanks

    Making a split library portable
    Here are typical layouts for the iTunes folders:
    If the iTunes folder contains the iTunes Media folder as above then the iTunes folder can be moved to a new location/drive/computer without breaking the file references. Although it is possible to migrate a split library from one system to another, the media folder must end up at precisely the same drive letter & path on the target system. This is feasible when moving between Windows systems, possibly feasible moving between Macs, but definitely impossible when moving PC to Mac or vice versa.
    Assume the media folder on the external drive is called ..\<Parent>\<Media> and the library files are in the usual place of <Profile's Music>\iTunes.
    You need to copy the library files and Album Artwork folder into the <Parent> folder, then use the hold-down-shift-when-starting-iTunes method (hold down option for Macs) to open the copy of the database that you've made in the <Parent> folder.
    Once this library has been opened and tested there are a few changes you can make so that it conforms to the standard layout. When iTunes opens it uses the folder name where the database is located as the window name so if the <Parent> folder isn't called iTunes then neither will be the main iTunes window. Close iTunes, rename <Parent> as iTunes and use the hold-down-shift-when-starting-iTunes method to open iTunes again. If <Parent> is the root of the drive, make a new folder called iTunes and move the library files, Album Artwork & <Media> folders into the new iTunes folder instead. Start iTunes, then check under Edit > Preferences > Advanced that the media folder location has been correctly updated and edit if necessary.
    You may also want to correct the media folder name. Having applied the fix above, if it was necessary, close iTunes then rename the <Media> folder as iTunes Media. Start iTunes and again check under Edit > Preferences > Advanced that the media folder location has been correctly updated and edit if necessary.
    Congratulations, your library is now fully portable and you can connect your external drive to any computer running the same build of iTunes, Mac or PC, in order to work with it. Don't forget to deauthorise the old computer if you won't need to access protected content on it again.
    tt2

  • ITunes not displayng songs after moving folder

    I moved all my songs from my C drive to a new external drive, which is G. I created the folder iTunes\iTunes Music and copies all my music from where it was to the new location and then deleted it from the C. I confirmed that all my music is there at the new location, as when I click on the new iTunes Music folder, it shows folders named with all the songs I had, and I confirmed that the G drive is using up the same space as iTunes Music took in the C drive.
    In iTunes, in Edit\Preferences\Advanced, it shows in the iTunes music folder location G:\iTunes\iTunes Music, which is where I changed it.
    When I load itunes, there are no songs displayed. Why?
    Did I do something wrong? I'm stumped.
    I rebooted my pc and loaded iTunes, but no difference.

    Hi,
    Try posting in the iTunes for Windows forum - someone more likely to know what the issue is will be lurking there

  • Even after consolidating, itunes library does not mirror music folder

    i copied my itunes music folder from my old harddrive to my new computer. some of the songs in the library are not in the music folder. how could this be if i copied the folder? is there a way to make them exactly alike? is it even important for them to be the same if my library has all my songs? i tried consolidating to my music folder but that didn't help anything. i use only itunes for music and i am very confused as to why they don't match up even though i have itunes copy every import into the music folder.
    HP Pavilion   Windows XP   MCE

    This area is for G5 iMacs.
    Suggest you repost your question in one of the iTunes for Windows Forums so that other users of Windows computers can see your question & help you.
    Good Luck!

  • How to delete tracks from Music Folder?

    After selecting all of the tracks of one of my iTunes playlists, i.e., an album, and clicking Option + Delete to move them to the Trash, I accidentally clicked Enter and, by default, selected the "Keep Files" option instead of the "Move to Trash" option in the "Do you want to move the selected songs to the Trash, or keep them in the iTunes Music folder?" dialogue box. I went to Home > Music folder > iTunes folder > iTunes Music folder > the folder of the album artist, but I do not see the folder of the album in the artist folder. How can I find these tracks so that I can send them to the Trash as intended?
    Thanks,
    Paul

    After performing a (Finder) Find for .aif files, I located the tracks and was able to delete the playlist (album) folder with the tracks. So no assistance needed after all.
    However, inexplicably, the folder with the tracks to be deleted was located in iTunes Music folder > Compilations folder, rather than in the artist folder. After finding and moving the folder of the tracks to the Trash, I checked the info of the original CD in iTunes out of curiosity and discovered that "Part of a compilation" was checked for the tracks, even though this is not a compilation (or even a live) album. I assume this sort of...tagging, I guess...was originally imbedded in the CD and is not a result of any glitch in iTunes. In fact, in the Compilations folder, I noticed several albums which are not compilation albums. I'd appreciate any thoughts or explanations as to why some non-compilation albums are checked as compilation albums.
    Thanks,
    Paul

  • ITunes Library cannot find my music nor movie.

    I have spend long nights now, but cannot figure out what is happening:
    I have a brand new iMAC PC and am switching from Windows to MAC so everything is new. Actually I though I could connect my iPod just like that, but no...after different kind of problems I managed to move all music files to iTunes Music (incl folders with PODCASTs and MOVIES), using an external HHD, so far so good. But there is no way I can import the music and movie to the library. Podcasts rolled over without any problems and now I have only some fotos & podcast on my iTouch!
    Importing from a CD works fine! And when I click on Music & movies under the library it is filled with 'old' files which cannot be found and I am also unable to delete these.
    Another thing which I find strange, when looking up a song in FINDER and clicking on it, it opens and plays, but not in iTunes.
    Can anyone help???Much appreciated, because I so dissapointed....THX

    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't normally lose a thing or need to do any further housekeeping.  Note that in iTunes 11 an "empty" library may show your past purchases with links to stream or download them.
    In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    Alternatively, depending on exactly when and why the library went missing, there may be a more recent .tmp file in the main iTunes folder that can be renamed as iTunes Library.itl to restore the library to a recent state.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    Should you be in the unfortunate position where you are no longer able to access your original library, or a backup of it, then see Recover your iTunes library from your iPod or iOS device.
    Would you mind telling me which anti-virus package you use? It may be that it is disturbing iTunes when it tries to write out the fresh database, as it does after almost any activity with your library. I'm noticing more of this type of problem than usual and trying to see if there is any pattern. It may help to prevent a repeat of the problem if you look at the advanced options for your AV package and see if you can find a way to exclude the main iTunes library folder (and subfolders if possible) from any real-time scanning process.
    tt2

  • Itunes 7.5 not syncing music folder but podcasts sync fine

    Hello,
    I'm hoping someone can offer some advice. Since upgrading to iTunes 7.5 and Vista, I've noticed that my iPod classic and iTunes are no longer syncing the Music folder in my library. I've been able to repeat the following behavior:
    - music files purchased from the iTunes store do not automatically update my iPod. I can, however, drag those files to my iPod manually.
    - music files from non-CD external sources do not automatically update my iPod. I cannot drag those files to my iPod.
    - files in the Podcast folder behave as I would expect. They update my iPod whenever I connect with no intervention required on my part.

    I had a similar problem with my iPhone 4S. First time syncing all my music seemed to be transferring. Then, when sync had finished, the iPhone reported that 416 tracks could not be transferred and I should see iTunes for details.
    iTunes had no details to give of course and when I tried another sync nothing happened to the tracks that were missing. In fact, when beginning to sync the iPhone would report 11.9GB of music on the phone and then at the end of sync that would drop to 7.3GB, which accounted for the 416 tracks missing.
    Also, when I clicked on the phone in the Devices Tab, and opened up the triangular arrow, then clicked music, I could see the missing tracks greyed out and having the sync symbol at the start of the columns.
    Eventually I figured out how the fix this. It seems to be something to do with a corruption in the ID tags or the modification dates. I changed the genre of all the affected tracks to 'Other' (they were set as various things before - Other just changed them to something else.. it is the change that is important).
    Then all the tracks transferred across fine.
    Weird!
    Hope this helps...

  • How do i get itunes to find the correct music folder on my computer?

    I just got a new computer.  I loaded itunes and it found the wrong music folder.  I have tried to drag and drop all of the music into the folder it found, but it somehow did not work.  I cannot find all of my old playlists and a lot of the music i had.  What do i do?

    See this migrate iTunes library post or Recover your iTunes library from your iPod or iOS device.
    tt2

  • UNUSUAL iTunes 7 Error while Adding Music Folder

    It's seems fairly simple, I am suprised thousands of others have not had this same problem. After I installed iTunes 7 I was adding a music folder (containing 4000+ songs) that is on an external HD...so,
    1) iTunes notes that I have .wma files in the folder
    2) I click either skip or convert, it doesn't matter
    3) iTunes promptly has an error and closes.
    However, if I use Windows search and exclusively find *.mp3 files, I can add thousands of them at a time without a problem. I would just let it be except I want my .wma's converted and there are multiple video files also in this folder that I don't want to have to find individually.
    This error has occurred again and again regardless of restarting the program or the system.
    Please Help!!!
    HP Compaq tc4200 Tablet Windows XP

    Hi
    Due to some kind of copy protection in iTunes - I don't copy directly from this in iMovie
    to my projects. (Most often the result of doing it in iMovie is a DVD without any sound)
    I do
    • In iTunes - collect needed audio into a new Playlist
    • then burn this out as an Audio-CD .aiff (NOT .mp3)
    • This CD I copy into a folder on my Mac (often containing other material that's connected to the project)
    • And then I drag and drop these .aiff files into my movie project in iMovie.
    This works Greatly and even more so when I do my DVD.
    Yours Bengt W

  • Itunes can not find My Music folder

    I recently had a friend who backed-up my music folder to a external hard drive. After a while it was to complicated to use, so I moved all my music back to my laptop. Now when I start iTunes, it states
    "The folder "i Tunes" cannot be found or created, and is required. The default location for this folder is the "My Music" folder
    I followed instructions from the Apple website to download Tweak UI, but even that doesn't list "My Music" folder. It list all the others, "My Pictures etc."
    When I click on my documents, "My Music" is there with the "Itunes" folder, but I am still unable to get Itunes to work. Please help.
    Dell   Windows XP   Nano

    hiya!
    in the cases where "My Music" doesn't appear as an option in TweakUI, we've been having some success using the alternate procedure in this Nigel Carpenter post:
    Nigel Carpenter: re: Itunes problem
    love, b

  • ITunes can't find My Music folder & won't launch - Vista OS

    Hello,
    I've been using iTunes successfully for months with Vista, then one day iTunes wouldn't launch. I got the error message "The folder itunes cannot be found or created and is required. The default location for this folder is inside the my music folder."
    I've seen a similar post but for Windows XP - referencing a system registry problem.
    This doesn't seem relevant because Vista doesn't even have a My Music folder. The folder is named "Music" and is not located in My Documents.
    Can anybody help? Thanks!
    I upgraded to Windows Vista on my Sony VAIO desktop. There w

    Then I already gave you your answer in a previous post.
    By the way:
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391
    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/message/13025536 and https://discussions.apple.com/message/17457605

  • Itunes can't find my music folder

    I can't install Itunes....it downloads fine from the exe file but when i try to open itunes it gives me the error msg that it can't find My Music folder. I went to the support page and it told me that if i couldn't find My Music folder to create one in My documents and download/install Tweak UI. I did and followed all the steps except when it asks me to click on My computer, then special folder and can't find the My Music folder to move it. I am using Windows XP....Please help. Has anyone ever had this problems?

    I finally found a solution here: http://forums.techarena.in/windows-xp-support/983948.htm
    it's stupid, you have to hold down the shift key while you open iTunes (don't just hold it while you click, keep holding it until iTunes actually shows the library dialog).

Maybe you are looking for