I Completely Screwed Up My Apple Music Library

Okay, I'm an idiot and I know it.

MacBook M1 Pro, Ventura 13.3.1, Apple Music 1.3.4.56


I wanted to move my Apple Music library (85,000+ songs) to a different external drive. I did not know that since the changeover from iTunes to Apple Music there is now a .musiclibrary file. I copied all the files to the new drive, started Apple Music with Option held down to get Select Library, selected the .itl file from the directory, went into the app's advanced settings and set the new directory as the location for Music Media folder, and everything went kablooey.


When I restarted Apple Music, it could no longer find about 25,000 of my 85,000 songs. I would go to play a song, click on the locate song button, it would find it, it would ask if I should use that location to find the other 25k songs, and it wouldn't find them.


I dug an older version of the .musiclibrary file from a backup, restarted Apple Music against this one, and now Apple Music can't find any of my files at all - almost everything is there but working against what's in the cloud )(either matched or uploaded) rather than the files on my disk (in either the old drive or the new).


I have no idea of how to get back to the state I was in a week ago, short of deleting everything and reloading the app from zero. But will that work or will it screw things up further? Will I lose (and need to manually recreate) my 50 or 100 playlists?


What else can I try?





MacBook Pro 14″

Posted on Apr 28, 2023 02:16 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 28, 2023 02:19 PM

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, (see the iTunes Media Organization section of Managing your Mac media libraries - Apple Community for details) 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

6 replies
Question marked as Top-ranking reply

Apr 28, 2023 02:19 PM in response to SpikeHK

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, (see the iTunes Media Organization section of Managing your Mac media libraries - Apple Community for details) 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

Apr 29, 2023 12:18 PM in response to SpikeHK

See Managing your Mac media libraries - Apple Community for some general advice. The basic method is to either move the whole library as a unit when it is in the standard layout (library folder containing media folder) or copy the library folder to a new drive, open the library on the new path, reset the media folder, then consolidate the library. I.e. with Music closed copy ~/Music/Music to the top of your external drive as <External>/Music, hold down option as you launch Music, choose library, then open <External>/Music/Music Library.musiclibrary, use Music > Preferences > Files to reset the media folder to <External>/Music/Media, then use File > Library > Organize Library > Consolidate Files to copy in all of the content from wherever it is located. Finally backup your library to another drive and clean up the old media locations to reclaim space.


tt2

Apr 29, 2023 09:56 AM in response to turingtest2

I appreciate your detailed response. I realized I was doing a lot of things bass-ackwards and managed to get myself back to my last "good day" - with all files properly located within Apple Music. I'll put the steps I took (in case it might be helpful to others later). But then the question becomes how I do the move of my library from one external drive to a different one without screwing things up?


My files were on an external drive/volume called AppleMusic, in a directory called /iTunes/Music.


As I later discovered, there were two directories with a Music Library.musiclibrary file:

The first was in /Macintosh HD/Users/spike/Music/Music

The second was in /Macintosh HD/Users/spike/Music/SpikeMusic


I went back to the last "good" day as far as I could tell, which was April 22nd, and downloaded those two directories from my backup stored on Backblaze. (As best as I can remember, the only changes I might have made to the library after April 22 would have been minimal at most.)


From the downloads, I could see that the .musiclibrary file in /Music/Music was 33.3 MB, the one in /Music/SpikeMusic was 1.26 GB, and I knew the larger one was the correct one.


So I started up Apple Music with OPT held down and selected the library from /Music/SpikeMusic from April 22.


This loaded 83,133 items and I could see that this was now referencing files on my disk and not just files in the cloud. I could also see that it was able to find all of the files on the /AppleMusic volume. So one problem solved!


Now I just need to figure out how to CORRECTLY move the files to a different drive!








Under settings - advanced, Music Media folder location is: /AppleMusic/iTunes/Music

Keep Music Media folder organized is checked, Copy files to Music Media folder is checked.


It loaded 83k songs, all from the Cloud, none from the files on the hard disk.


Under settings I changed the location of the Music Media folder back to /Macintosh HD/Users/spike/Music/Music and answered "yes" to the "would you like to move and rename" question.







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.

I Completely Screwed Up My Apple Music Library

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