Apple Music problems after moving to external hard drive

I moved my Music library to an external hard drive and all seemed good until I found that the links to the tracks didn't work(there are 25,000). I tried following advice here about running a script to resolve this but I am not sure how to implement the script.

To make matters worse I tried to add to the library a disc that hadn't been previously in the library but is in the Media folder and the disc disappeared.

Could someone explain simply how I execute the script in the most basic way possible. The script I found is:

<Target Folder>/<[Album]Artist>/<Album>/[[D-]## ]<Name>[ 1].<Ext>

When I tried to run this a dialogue box told me of errors which prevented it from running.

I'm using an M1 MacBook Pro running Sequoia 15.1.1

MacBook Pro 16″, macOS 15.1

Posted on Apr 6, 2025 3:46 AM

Reply
9 replies
Sort By: 

Apr 6, 2025 4:01 AM in response to clarinete13

Hi,


This is not a script:-


<Target Folder>/<[Album]Artist>/<Album>/[[D-]## ]<Name>[ 1].<Ext>


It is a description in Backus–Naur form (BNF) of the expected path of each track in terms of its properties. The square brackets are optional terms. Things in angled brackets are replaced with the referenced term, and the rest are literals.



Below is my boilerplate on missing tracks. It concludes with a link to an AppleScript that can repair tracks as long as they are in a reasonably expected layout.




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

Reply

Apr 6, 2025 6:05 AM in response to clarinete13

  1. Apple helpfully <sarcasm> changed the menu at some point. This data point is now Music > Settings > Files > Music Media folder location.
  2. OK, somewhat non-standard but at least it looks something like <A Media Folder Path>/<Artist>/<Album>/## <Name>.<Ext>, so hopefully they are still in a useful location in their new home.
  3. I'd expect you to respond with something like <New External Drive Name>/<A Media Folder Path>/Bert Jansch/The Black Swan/01 The Black Swan.aif where you've searched your external drive (manually or with Finder search) and determined the path of that file.


Consolidating files copies anything currently located outside of the designated media folder into it, and updates the library to point to the new copy. It cannot do anything with a track that isn't where it is supposed to be. See Managing your Mac media libraries - Apple Community for some general background on the standard layout for Music's media folder. Depending on the choices for Keep... & Copy... on the Music > Settings > Files tab content added to the library can be left where it is, copied into the media folder, and/or moved around to reflect updated properties. In some cases tracks will be moved from their existing location into a deeper <Media Folder>/Music path, or into a Compilations folder.


tt2

Reply

Apr 7, 2025 3:22 AM in response to clarinete13

Hi,


Yes, from the look of things your artist folders should be in either the /CD's-Rock etc/Media folder, or perhaps /CD's-Rock etc/Media/Music depending on where Music has put something else that currently plays. See the section on iTunes Media Organization in Managing your Mac media libraries - Apple Community for more on that distinction. Putting them in what should now be the right place won't necessarily be enough however as item 2. above shows that library still, perhaps, expects to see the files on a volume called Music. Is that a previous external drive no longer connected? Anyway, you can try moving the artist folders to the correct location with respect to the media folder (being careful not to overwrite any folders) then try repairing a broken song and see if Music will automatically repair the others. If not then you can try my script FixLinks - an AppleScript to repair broken links in Music - Apple Community.


tt2

Reply

Apr 6, 2025 4:50 AM in response to turingtest2

Thanks for coming back to me so quickly. I did try the repair permissions route but that didn't work. I'm sorry but where am I looking for iTunes|Music > Preferences > Advanced? In the Library?

The Media folder is on the external drive, it is now empty as I was going to try a different approach and consolidate files using the 'Organise Library' dialogue box. I started to do this and it did work but instead of copying the media and leaving the original in its position it started moving the files into the Media files Folder and deleting them from the original position.

Again my ignorance means I don't know how to give you the true path.


  1. ?
  2. file:///Volumes/Music/CD's/Bert Jansch/The Black Swan/01 The Black Swan.aif
  3. ?


Not very helpful I know.


Reply

Apr 6, 2025 6:17 AM in response to turingtest2

Ok, this what I have.


  1. /CD's-Rock etc/Media
  2. file:///Volumes/Music/CD's/Bert Jansch/The Black Swan/01 The Black Swan.aif
  3. CD's-Rock etc/CD's/Bert Jansch/The Black Swan/01 The Black Swan.aif



I maybe wrong but it seems to think the Music library is still on my computer and not on the new drive. If this is correct how do should I change this.

Can I leave the files in the CD's folder or should I be moving/putting them in the Media folder.

Reply

Apr 8, 2025 2:19 AM in response to turingtest2

I tried to reorganise the library, -54 error code, I put the CD's in the media folder, still no joy. I tried the locate files, pointed it to the file and the track was removed from the media folder and I can't trace where it has gone.

I then tried the script on one folder of tracks, said it couldn't find the tracks apart from the one that had already been located(which has disappeared). If I could find the lost track it would help.

Why is this so ridiculously complicated? When I used iTunes on my pre-silicon MacBook Pro everything worked seamlessly, now the assumption is everyone downloads or streams.

I tried using JRiver and it was incredibly simple and worked, the only reason I need Apple Music is because I can't find anything else to facilitate playing music on my phone using a selection of albums from my library.

Very frustrated!

Reply

Apr 8, 2025 3:00 AM in response to clarinete13

clarinete13 wrote:

Ok, this what I have.

1. /CD's-Rock etc/Media
2. file:///Volumes/Music/CD's/Bert Jansch/The Black Swan/01 The Black Swan.aif
3. CD's-Rock etc/CD's/Bert Jansch/The Black Swan/01 The Black Swan.aif


Looking at this again I wonder if it is simple as renaming your drive from CD's Rock etc to Music. That should at least put this particular example back where it is expected to be.


tt2

Reply

Apr 8, 2025 3:46 AM in response to turingtest2

Well something weird happened. I started again with the basics, copied the complete Music folder from the M1 Mac to the external drive(I had done this before), whilst opening Apple Music from the sidebar I held down the option key and was prompted to choose or create a new library and suddenly the old CD's-Rock etc folder(which had been deleted and called 'Music') appeared with the library name Music Library.musiclibrary, the Media folder and the all important 'Automatically Add to Music' folder. Needless to say but I chose this and everything seems to be working.

Thank you for your patience and guidance, I'm not quite sure how it has been resolved but it is working.


There is one side question unrelated to the above and I'm curious whether you know anything about it.

I discovered last week that every CD I have imported into my M1 MacBook Pro since I bought it(2022) is audibly flawed. The sound is degraded at the end of tracks and sometimes at the beginning. After trying two different CD/DVD writers including the Apple one I couldn't resolve. I started using XLD and JRiver and the imports were fine, is this a silicon Mac issue?

Reply

Apr 8, 2025 8:56 AM in response to clarinete13

Glad to hear you seem to have got the library working on the external drive now.


I'm not aware of any general issue with CD ripping that is particular to M series Macs or recent versions of macOS. That said I haven't personally ripped a CD in ages, but I think I spend enough time looking at threads here to have noticed a pattern if it were being reported.


tt2

Reply

Apple Music problems after moving to external hard drive

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