Gigantic Library split over two locations

Got a new MacBook Pro M3 in Dec 2023 that has been pretty reliable. We made the switch from a Seagate 16TB USB external drive that was constantly ejecting to a RAID set-up that has been stable. This happened

in March 2024. The majority of the library (~11TB) is on the RAID unit (~20TB), but all the music that has been imported since March 2024 is on the local HD. Music plays everything without issue. Is there a good way to fix this without a giant headache? The internal HD has gone from 1TB down to 350GB left, so it's a significant amount of albums.

Drag the "Music" folder from the local HD to the RAID unit and point each album over there? Delete the folders (there are a lot) and re-import them once library knows to look at the RAID again? We use all the music for work and don't want to lose days or weeks fixing this if there's an easier solution.


Should the media file that tells music where everything is be on the RAID or the laptop?


Thanks!

MacBook Pro 16″, macOS 14.5

Posted on Oct 4, 2024 8:37 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 4, 2024 11:05 AM

Use Music > Preferences > Files to set the media folder location to the folder containing your content on the RAID drive. You may be prompted to consolidate to that location when you set it, or you can do so via File > Library > Organize Library > Consolidate Files. This will create copies of the files that are currently on the local HD and update the library such that it points to the new copies. Once the process is complete you can manually clean up the old media folder location on the internal drive.


There is an advantage to having the .musiclibrary package in the same folder as the media folder as the library can then be easily cloned to another drive for security. Reading the library from a RAID location may be less efficient however, so there may not be any benefit in going through the steps to rearrange the library into this shape.


tt2

Similar questions

31 replies
Question marked as Top-ranking reply

Oct 4, 2024 11:05 AM in response to DHeckeler

Use Music > Preferences > Files to set the media folder location to the folder containing your content on the RAID drive. You may be prompted to consolidate to that location when you set it, or you can do so via File > Library > Organize Library > Consolidate Files. This will create copies of the files that are currently on the local HD and update the library such that it points to the new copies. Once the process is complete you can manually clean up the old media folder location on the internal drive.


There is an advantage to having the .musiclibrary package in the same folder as the media folder as the library can then be easily cloned to another drive for security. Reading the library from a RAID location may be less efficient however, so there may not be any benefit in going through the steps to rearrange the library into this shape.


tt2

Nov 16, 2024 11:48 AM in response to DHeckeler

Hi.


It is possible I've missed something by not going back over the whole thread, but if you consolidate (File > Library > Organize Library > Consolidate Files - check the media folder is the right path on the RAID first) from the laptop (where everything plays correctly) to the media folder on the RAID then that should update the locations so that all items are on the RAID. Following this an exported XML version of the library should import into another library on another device, or you can simply copy the working library over to a same or newer version of macOS which will preserve date added. Also saves you manually locating 3,800 files in the library.


With that said, if you delete a track entry from the library that removes all references to that track from all playlists.


tt2

Oct 7, 2024 9:36 AM in response to DHeckeler

I suspect you're going to have to roll back everything, but try holding down option+cmd as you launch Music which opens it in its safe mode and does some internal consistency checks. If you're using a .musiclibrary restored from backup hold down option as you launch Music and explicitly chose the restored file in case the app is actually opening a cached copy of the library.


tt2

Nov 16, 2024 12:17 PM in response to DHeckeler

The aim of consolidating is to go through every track in the library and inspect its location. If it is within the currently designated media folder nothing happens. If outside the media folder a fresh copy of the file is made inside the media folder and the entry in the library is updated to point to the new copy. Were the multiple -54 errors or just one. Did the error occur immediately, or is there any indication to suggest some files were copied over and updated?


iTunes used to have a feature to consolidate selected files, which could be handy when trying to isolate particular files that were causing a problem. There is a script here - https://dougscripts.com/itunes/scripts/ss.php?sp=mxrelocateselected - that sort of does the same thing, but unfortunately it doesn't appear to build artist and album folders automatically so isn't quite as useful as it might be.


If you're going to have to do everything manually then it should be possible to write something to process the XML data and fish out all of the locations from the rest of the data and pop them into say a CSV file, which could then be sorted to show the paths in order, which would simplify the search task somewhat.


tt2

Oct 4, 2024 1:59 PM in response to DHeckeler

Exactly, anything located outside the designated media folder is copied into it. Whatever is already there stays put. See Managing your Mac media libraries - Apple Community for some further background. The media folder would typically contain folders for each type of media, or some of those and all artist folders, depending on any previous history with different builds of iTunes. While manually moving things around on local HFS+/APFS drives should be OK I'd be wary of moving anything by hand on the RAID.


tt2

Oct 11, 2024 8:34 AM in response to DHeckeler

Whatever was done with locating or relocating those files, those files are being accessed remotely.


Whether you added that linkage without realizing, or some corruption thoughtfully added that?


First step is rebuilding the playlist.


Second is reviewing the 54,000 music files involved. (I keep my music library consolidated, so I don’t know if Get Info (in Music app) will show a local or remote location for a song. It might.)

Oct 12, 2024 10:11 AM in response to DHeckeler

File > Library > Export Playlist... Choose the XML format.

Rename the original copy of the playlist.

File > Library > Import Playlist... Select the exported file.

A new playlist with the old name will be generated, only tracks that can be physically located will be added to that list.


Drag and drop a selection of tracks from one list to a new empty list should also have the same result.


I've assumed the source list is a regular playlist. If it is a smart list then the second method will give you a regular list with validated tracks.


tt2

Oct 12, 2024 1:18 PM in response to DHeckeler

DHeckeler wrote:

I've never done this before. What should I be looking for in the XML file? Thank you!


XML is a text file, and is readable. Each field in an XML file is tagged, and related fields (such as each playlist entry) are nested.


Here is a hunk of the XML of an exported playlist, showing part of one track within the playlist:

<key>6842</key>
		<dict>
			<key>Track ID</key><integer>6842</integer>
			<key>Name</key><string>Espacio Sideral</string>
			<key>Artist</key><string>Jesse &#38; Joy</string>
			<key>Album Artist</key><string>Jesse &#38; Joy</string>
			<key>Composer</key><string>Jesse Huerta &#38; Joy Huerta</string>
			... {stuff here deleted } ... 
			<key>Apple Music</key><true/>
			<key>Location</key><string>file:///Users/mrhoffman/Music/iTunes/iTunes%20Music/Apple%20Music/Compilations/Jesse%20&#38;%20Joy/03%20Espacio%20Sideral.m4p</string>
			<key>File Folder Count</key><integer>5</integer>
			<key>Library Folder Count</key><integer>1</integer>
		</dict>


Each track will have information containing the full file name of the file containing the music.


From a test XML created and exported here (from a consolidated music library, which means stuff isn't located all over), the file location info from the XML file looks like this:

<key>Location</key><string>file:///Users/mrhoffman/Music/iTunes/iTunes%20Music/Apple%20Music/Compilations/Jesse%20&#38;%20Joy/03%20Espacio%20Sideral.m4p</string>


This location is a standard URL, like those that work with a web browser. (This uses standard URL encoding too, which means the %20 is a space, and &#38 is an & ampersand character.)


In this example, the file:/// means the location is a file, a colon and three slashes immediately following means no host name is specified; that the referenced location is local. If you see entries with a host name between the second and third slashes, that particular track is not located locally. It's on a file server or host somewhere, and that could conceivably be the local host accessed remotely.


An example of a remote file specification for a file served by the host fileserver.example.com looks like this:

file://fileserver.example.com/Users/mrhoffman {rest of path here}


You can use a search tool in your preferred editor, or a command-line tool such as grep, to search for just the location entries from the file, which will make this all less to look at.


The following is an example of using the grep tool available in zsh and other command line shells to search for the location entries for the tracks included in the playlist XML file named Jesse y Joy.xml :

% grep -i ">location<" "/Users/mrhoffman/Documents/Jesse y Joy.xml"
... {stuff expurated} ...
			<key>Location</key><string>file:///Users/mrhoffman/Music/iTunes/iTunes%20Music/Apple%20Music/Compilations/Jesse%20&#38;%20Joy/03%20Espacio%20Sideral.m4p</string>
... {stuff expurated} ...
mrhoffman@cupertino ~ % 


There are quite probably better tools for managing enormous libraries too, or at least for reading and processing XML playlist files.


TL;DR: look for locations in the XML that don't include a string starting with file:///

Oct 6, 2024 6:03 AM in response to turingtest2

Thanks for your help getting started on this.


Pointed Music to the RAID drive. It asked if we wanted to rename all the files so that it would be easy to find. Clicked on "Yes" and it started the process. Took about 16 hours and there are no gray exclamation points which is great! Tested 10 songs and 3 played fine, the other 7 play but about 8 seconds in the sound garbled kind of like a modem used to during dial-up days and you can't listen to them. I closed Music to restart and it brings up a "Saving Music Library" window that has a bar that goes back and forth on it for about 10 hours now. I checked under Force Quit menu and it doesn't say Music is not responding so we just let it go until it's done? How long could that possibly take?


At no point did it ask us if we wanted to consolidate the library. The music did not transfer to the RAID when it asked about renaming the files. I will do that next if the program ever actually quits. We have a Time Machine back-up of the computer from right before we started this (it backs up on hourly basis?) so if we need to start over we can. Ideally we don't want to lose days to this.


Any more thoughts?

Oct 7, 2024 6:34 AM in response to DHeckeler

Ouch. I'd have skipped the renaming if asked. It probably renamed files according to the details set out in the iTunes Media Organization section of Managing your Mac media libraries - Apple Community, which in and of itself ought not to have had any impact on the content of the files. You can recover the state of the library from the Time Machine backup, but do you have a backup of the RAID as well?


tt2

Oct 7, 2024 8:00 AM in response to turingtest2

I sure hope it didn't rename anything based on outside sources. Yes we have a back up of the RAID, we do Carbon Copy Cloner on it several times a week. Had a external drive fail about a decade ago and will never make that mistake again! We then back up the CCC external drive to another so there's two back-ups at all times.


Force quitting and restarting Music fixed the two issues above. I will try to consolidate the libraries in a few days. Need to get caught back up after losing two days to the switch.


Thanks again for helping!

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.

Gigantic Library split over two locations

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