Can I change the location of a song in Catalina Music?

Is it possible to tell my songs in Catalina's Music app the correct location if it has a wrong location? I have some songs copied to wrong directories. The original songs are where they belong, but the Music App sees some songs in a folder it created weirdly elsewhere.


Also, I have some songs that point to the a copied song instead of the original. I'd like to get rid of song1.m4a, but the music app is pointing there instead of the song.m4a in the same folder.



iMac Line (2012 and Later)

Posted on May 17, 2020 6:46 PM

Reply
Question marked as Top-ranking reply

Posted on May 27, 2020 12:39 AM

How big is the library? How much free space do you have? If possible you would reset the media folder to /Users/HBrazee/Music/Music/Media, use File > Library > Organize Library > Consolidate Files to copy in everything, then delete all of the artist folders that are within /Users/HBrazee/Music/ but not in /Users/HBrazee/Music/Music/Media.


In a vanilla Catalina install ~/Music contains a single folder called Music, which in turn contains the only the package Music Library.musiclibrary and a folder called Media. All music connected to the library is inside Media.


tt2

Similar questions

54 replies
Question marked as Top-ranking reply

May 27, 2020 12:39 AM in response to howardfromlafayette

How big is the library? How much free space do you have? If possible you would reset the media folder to /Users/HBrazee/Music/Music/Media, use File > Library > Organize Library > Consolidate Files to copy in everything, then delete all of the artist folders that are within /Users/HBrazee/Music/ but not in /Users/HBrazee/Music/Music/Media.


In a vanilla Catalina install ~/Music contains a single folder called Music, which in turn contains the only the package Music Library.musiclibrary and a folder called Media. All music connected to the library is inside Media.


tt2

May 27, 2020 9:47 AM in response to howardfromlafayette

Looks like you have enough space for temporary duplication. I suggest you use the menu Music > Preferences > Files > Reset. This should reset the media folder to /Users/HBrazee/Music/Music/Media. Assuming that is the value offered (so I've correctly identified where your .musiclibrary file is, then when you click OK Music may offer to consolidate your files, which you can let it do. If it doesn't offer to consolidate automatically then you can use File > Library > Organize Library > Consolidate Files to do that. Once the media has been copied into /Users/HBrazee/Music/Music/Media you can delete the old artist folders in the higher up Music folders to reclaim the space.


tt2

May 19, 2020 7:22 AM in response to howardfromlafayette

The exclamation marks are only shown once the library has had cause to notice that tracks aren't at their expected locations. This is a trick for revealing dead links which I assume still works in Music.


Lost & Found Playlists

Create a playlist called Found, select everything in Music and drag it into the Found playlist. Create a smart playlist called Lost matching only Music items and the rule Playlist is not Found. Your lost tracks will be in this playlist.


I've got Windows scripts for fixing broken links and safely deduping but I can't directly port those to OS X. If you look at Get Info (Cmd+I) for a broken track without trying to fix it and then look at the File tab you should be able to work out where Music thinks that track ought to be. Perhaps it is possibly for you to move things to where they should be. If you can show me the broken path and the real location I might have some insight.


tt2

May 25, 2020 6:29 AM in response to howardfromlafayette

Consolidate will only copy anything that is currently outside the designated media folder into it, if it is an item with an unbroken link. It won't fix anything that is broken. The Reorganize files is a one time option that adds the additional Music folder within the targeted media folder. In iTunes this made more sense as it established separate folders for each media kind within the media folder. It is less relevant for Music, but Apple haven't provided a mechanism to undo it once it is enabled.


Please select one of the tracks that shows with an exclamation mark, use Cmd+i to Get Song Info, don't locate the file, then look on the File tab for the Location that Music is trying to use. Now find the true path to that file. Please post both paths here and I'll see if I can suggest actions to repair the links that don't involve working one file at a time.


tt2

May 25, 2020 9:50 AM in response to howardfromlafayette

Regarding the player choosing the copy rather than the original, move those copies out of your Music folder and tuck them away in a temporary folder on your desktop. Then, in Music select the songs in question and delete them from y our library. Don't delete the files, though. Once that's done, go back into your Music folder and double-click on the original song file. It should start playing in Music. When it does, check the info on the song and see what file it's playing. It should be the original, not the copy. If you're comfortable that Music is playing the proper file, you can then delete the temporary folder on your desktop.

May 25, 2020 2:37 AM in response to howardfromlafayette

The default path for the media folder in Catalina is ~/Music/Music/Media. A legacy setting from iTunes may optionally introduce an additional Music folder so that a typical song goes to ~/Music/Music/Media/Music/<Artist>/<Album>/## <Name>.<Ext>. Try moving an artist folder from ~/Music into ~/Music/Music/ to see if Music is then able to find those tracks that currently show with exclamation marks.


tt2

May 28, 2020 2:55 AM in response to howardfromlafayette

Try Music > Preferences > Files > Keep Music Media folder organized > Off and then Music > Preferences > Files > Keep Music Media folder organized > On. This should reorganize the content with in the media folder so that artist folders generally drop into the Music/Media folder if they are in the Music folder above.


Given you've got iCloud Music Library for the remaining exclamation marks that you cannot resolve by reconnecting to a local file you should be able to right-click the track, and use remove download, then click the download link that appears to download a new copy.


tt2

May 26, 2020 7:18 AM in response to howardfromlafayette

Sort the Song list as Album by Artist, then select all of the tracks by artists that begin with A and run the script again. Where you have both variations such as this:

and there are broken links the script will always pick the second track first so there is a risk that you may end up with two entries in the database connected to the same physical file (something I call a logical duplicate). Depending on how long it takes to do artists beginning with A, and how many failures that throws up, you might want to proceed one letter or time or go for the whole library.


I suggest we leave the niceties of deduping until after the broken links are resolved however if you want a brief grounding take a look at Duplicate songs in iTunes - Apple Community. Consolidating the library into the default media path of /Users/HBrazee/Music/Music/Media would remove the logical duplicates (each entry gets consolidated independently while the original file is left in place), which should make it safe to eliminate content that iCloud Library has already flagged as duplicates, deleting the underlying files at the same time, so as to clean up the resulting media folder and leave you the tracks with ratings and play counts. Turning keep orgainzed off and then on again will tidy up any trailing digits in the files that remain.


See Handling grey stars - Apple Community for more on what those are about and how you can eliminate them if desired. Definitely lower down on the priorities right now.


tt2

May 26, 2020 2:14 AM in response to howardfromlafayette

howardfromlafayette wrote:

Sorry for being so dense..

So do I test it with
/Users/HBrazee/Music/Amanda Palmer/Amanda Palmer Goes Down Under
Then later run it with /Users/HBrazee/Music/ ?


My mistake for not being clearer, and making an error in my suggested start point. As a test you would select the Amanda Palmer tracks in Music, then point the script at /Users/HBrazee/Music/ (I put an extra /Music in). It isn't as clever as my Windows version which has a variable depth search and partial matching. This script is going to look at:


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


Here I've deliberately renamed a file so it cannot be found. My target folder is /Users/steve/Music/FixLinks, and it is looking in the right folder for the track, but I added a trailing 3 which the script cannot check for so it failed to find it.



True path: /Users/steve/Music/FixLinks/a-ha/Take On Me/01 Take On Me 3.mp3 - if I restore the original filename it would be successful. As I say if you start in /Users/HBrazee/Music/ you should get a high degree of success based on the paths you've shared so far. I can refine the script once I know where it fails.


tt2

May 25, 2020 5:57 AM in response to turingtest2

That's weird. I've been trying to move things away from the music/music folder, thinking that the extra "music" level was a screw-up.


I have lots of songs pointing to both places. So just now I selected "Library/Organize Library/Consolidate Files", so that I could see the (!) songs. (Reorganize the files in the folder "Music" is still grayed out.)


I found a song, moved that artist from the music folder to the music/music folder. Then I selected that (!) version of the song and pointed it to that location. Now I had two copies of that song pointing tho the music/music location.


I selected "Library/Organize Library/Consolidate Files" again. It didn't seem to change anything. There is a "Matched" version of that song with played count, and a duplicate version without play count. I selected "Delete from Library" for that duplicate, selecting to keep the file.


This appears to be the same tedious routine I've been trying to do for weeks, fixing songs one by one, except instead of moving the artists to my Music folder, I'm moving artists to my Music/Music folder.


Is that what I need to continue doing, maybe working an hour per day for the rest of the year?

May 25, 2020 7:52 AM in response to howardfromlafayette

The file:// prefix is included for tracks that are missing. Unfortunately the broken entry is looking for a trailing 1 that the live file doesn't have so it isn't as simple as moving say the Ray Charles folder from /Users/HBrazee/Music/ to /Users/HBrazee/Music/Music which is what I was hoping for. I have a Windows script for relocating missing tracks but it isn't a simple port to AppleScript. I might be able to come up with something however. If the pattern is consistent, i.e. broken file link, real location User's Music/<[Album]Artist>/<Album>/## <Name>.<Ext> with or with a " 1" after the name then it ought to be possible to automate the process of relinking the tracks.


tt2

May 26, 2020 11:12 AM in response to howardfromlafayette

howardfromlafayette wrote:

I was wondering why you had me select my music.

The script processes selected tracks. Running against the whole library may not be prudent.


Could you put the URL of FixLinks in a comment in the code (and in your reply)?

Done, the updated script is at https://discussions.apple.com/docs/DOC-250002671


My wife wants me to go shopping right now. I cancelled the script after pressing OK 50 times for not found. I'll try again when I get back (or maybe try your newest version). (I saw that many of the rejections were in /music/compilations). Then I should run it again selecting /music/music?

Yes. Unless I can add in the code to do that automatically before you get back from the shops.


tt2

May 26, 2020 4:14 PM in response to howardfromlafayette

You might want to restore any music files that you have in the trash so that those could be relinked too.


In the second screenshot you're seeing a regular pattern of tracks that you want to keep with ratings and play counts interspersed with tracks that have a cloud status of duplicate. It should be possible to take such a selection, sort it on the cloud status column, then select and delete the tracks that are duplicates. In this case you can delete the underlying files as the remaining file should be a separate file and is the one that you want to keep. It is a little more complicated when you have reason to suspect that more than one entry is connected to the same physical file, although if you have iCloud Music Library then if you do accidentally eliminate the only copy you have it should be possible to right-click and remove download, then click the cloud to download a new copy.


tt2

May 28, 2020 8:12 AM in response to howardfromlafayette

The media folder is whatever is listed under Music > Preferences > Files.


Reorganise files in the folder "Media" is really a legacy from iTunes. It something you can set if it isn't set, but if the option is greyed out then it is already set. Back in iTunes it would music in a separate subfolder of the media folder in the same that Movies, Podcasts, TV Shows, etc. have always had their own subfolders. Back in the day artist folders would, by default, go into the main media folder. Reorganise... improved the folder layout. Now that Music only deals with Music it would be better if Apple included an option to undo it. If you'd like your artist folders to live one level higher use a text editor to edit the hidden file .Media Preferences.plist in your media folder, changing the line:


<integer>1</integer>


to:


<integer>0</integer>


The turn Keep organised off and back on again to refresh the layout.


If the tracks are marked as part of a compilation then they go to <Media Folder>[/Music]/Compilations rather than <Media Folder[/Music]/<Album Artist>. Often anthologies of a single artist's or band's works, e.g. Greatest Hits albums, will be classed as a compilation whereas this option is, in my opinion, better reserved for albums where each track is by a different artist.


You can use the use the Automatically Add to Music folder in the media folder to merge in new content and have it move to the right place.



And yes, you can delete ~/Music/Music if you're sure there is nothing left in there that you need.



Your library is currently one level higher than Catalina would use by default, but if it is working for you now I'd probably stop there.



tt2

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.

Can I change the location of a song in Catalina Music?

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