Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

elektrik

macrumors newbie
Original poster
Jan 26, 2011
7
5
Hi, I hope someone can help with this Music challenge.

I lost my Apple Music library but I have an iTunes library backup from late 2019. This was when my music files (about 75,000 music tracks) were stored on an external drive. The files are now on my Synology NAS. The library is on my iMac.

What I want to do: In the 2019 iTunes library, update the base file path from the old external drive to the NAS, then re-scan the main directory on the NAS for changes, so that "Recently Added" has everything new since 2019.

Now: When I open the 2019 library in Music, it converts/updates, but all the files are missing (of course). When I update the location of a file, it scans for more changes, but after a full day of scanning, there are duplicates of everything. All the album art is gone, too.

What I don't want to do: I could just create a new library from scratch, scanning everything on the NAS. But then I don't have the order in which I added albums (important to me) over the last few years.

Any suggestions for how to accomplish what I want, using Music or anything else? It's really striking how basic and unhelpful Music is, after all these years.

Thanks for the assistance,
E
 
  • Like
Reactions: stirfyrking2020

stirfyrking2020

macrumors newbie
Mar 5, 2023
2
0
Crazy timing. I am looking for the same fix. (also wiht a Synology). Will let you know if i come across anything.
 

stirfyrking2020

macrumors newbie
Mar 5, 2023
2
0
take a look at this suggestion from ChatGPT:

MY QUESTION:
is there a way to edit the catalogue file directly instead of doing this one playlist at a time?


CHATGPT RESPONSE:
It is possible to edit the catalog file directly to update the file paths for your music library in Apple Music. However, this process can be complex and potentially risky if not done carefully. It's recommended that you backup your music library before attempting any direct edits to the catalog file.
To edit the catalog file directly, you can follow these general steps:
  1. Close the Apple Music app.
  2. Locate the iTunes Library.itl file on your computer. This file contains the catalog information for your Apple Music library and is typically located in the Music folder on your computer.
  3. Open the iTunes Library.itl file in a text editor (such as Notepad on Windows or TextEdit on Mac).
  4. Use the Find function in your text editor to search for the old file path (MyMusic2) and replace it with the new file path (MyMusic100).
  5. Save the changes to the iTunes Library.itl file.
  6. Reopen the Apple Music app and wait for it to update the library with the new file paths.
Again, it's important to note that direct edits to the catalog file can be complex and potentially risky. It's always a good idea to backup your music library before making any changes, and it may be safer to update your playlists individually within the Apple Music app as described in my previous response.

Hope this helps. I will attemtp the procedure later this week.
 

elektrik

macrumors newbie
Original poster
Jan 26, 2011
7
5
take a look at this suggestion from ChatGPT:

MY QUESTION:
is there a way to edit the catalogue file directly instead of doing this one playlist at a time?


CHATGPT RESPONSE:
It is possible to edit the catalog file directly to update the file paths for your music library in Apple Music. However, this process can be complex and potentially risky if not done carefully. It's recommended that you backup your music library before attempting any direct edits to the catalog file.
To edit the catalog file directly, you can follow these general steps:
  1. Close the Apple Music app.
  2. Locate the iTunes Library.itl file on your computer. This file contains the catalog information for your Apple Music library and is typically located in the Music folder on your computer.
  3. Open the iTunes Library.itl file in a text editor (such as Notepad on Windows or TextEdit on Mac).
  4. Use the Find function in your text editor to search for the old file path (MyMusic2) and replace it with the new file path (MyMusic100).
  5. Save the changes to the iTunes Library.itl file.
  6. Reopen the Apple Music app and wait for it to update the library with the new file paths.
Again, it's important to note that direct edits to the catalog file can be complex and potentially risky. It's always a good idea to backup your music library before making any changes, and it may be safer to update your playlists individually within the Apple Music app as described in my previous response.

Hope this helps. I will attemtp the procedure later this week.
Thanks for posting and thinking of this.

When I open the .itl in TextEdit, it's not usable:

Screenshot 2023-03-05 at 9.24.44 PM.png


When I open the iTunes Music Library.xml, it can be read and has a location for each music file. Example:

<key>Location</key><string>file:///Users/*username*/old path*/A%20Tribe%20Called%20Quest/1991%20-%20The%20Low%20End%20Theory/01%20-%20A%20Tribe%20Called%20Quest%20-%20The%20Low%20End%20Theory%20-%20Excursions.mp3</string>

I did a Find & Replace, using the updated path to my NAS:

<key>Location</key><string>smb://*MySynologyName*/music/A%20Tribe%20Called%20Quest/1991%20-%20The%20Low%20End%20Theory/01%20-%20A%20Tribe%20Called%20Quest%20-%20The%20Low%20End%20Theory%20-%20Excursions.mp3</string>

Saved that file, created a new Music library, then File -> Library -> Import Playlist (File -> Import did nothing when I selected the updated xml file). It looks like imported everything, but it says the entire library was added today, and when I select a file, it doesn't play. Lost all the album artwork, too. So that's not the answer....I don't think?

Back to the drawing board...
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
Just came across this and found a solution, so thought I would share.

Assuming you do not use the "keep library arranged" checkbox, and the library just needs its base path changed:

1. close Music
2. the old/existing library location (if the music is still in place there), rename the based folder so Music won't find it and will see everything as missing.
3. open Music. Double click one song in the library (that will now be missing), click "Locate" and point it to the new location you have copied/moved the library to (the new disk etc)
4. it will ask you "Find others based on this?" click yes
5. Music will go through every song in the library to check if it's missing, then reassign it based on the parent directory structure of the song you clicked
6. for me it found about 80% on the first run, for some reason. Then I repeated the same with one of the 20% with the "missing icon" and it ran through and found every song on the second go

The above assumes you have copied the library already to a new disk or location, and the overall Artist > Album > Song directory structure hasn't changed (directories above Artist level don't matter, mine didn't match on the new location)

Hope this helps and you were actually trying to do the same as me. Basically Music rewrites the base path itself using the "Locate" feature (I'd bet the developers added this feature for exactly this use case, moving libraries about to new discs)
 

OldCorpse

macrumors 68000
Dec 7, 2005
1,758
347
compost heap
Thank you chinopozo for updating Music/iTunes/Library solutions. Many of us have all sorts of issues with these, because so many need to make transitions from external volumes with music files to migrate to newer macs and all kinds of issues come up. I myself have had issues (which I described and solved in a thread on the Audio section of MR), and I'm always on the lookout for folks dealing with this.
 

woodenbrain

macrumors member
Sep 2, 2009
74
8
for me it found about 80% on the first run, for some reason. Then I repeated the same with one of the 20% with the "missing icon" and it ran through and found every song on the second go
So as I just wrote here, this whole problem has kept me from buying a new Mac for years. Apple must figure out a way to deal with this problem! People need to move media files around, it's absurd there is no way to point iTunes at new paths (and multiple paths, not just one). Everything that was HERE is now HERE, and so forth as many times as needed.

Anyway -- I am in the process of doing as you described now. I have a 2TB MP3 library and iTunes (on Mojave) has been spinning now for 16 hours+. No sign of what it is doing other than Activity Monitor which is showing 38-42 open threads and occasionally showing as unresponsive but then waking back up.

How long did your "first run" take? How large is your library? Thank you.
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
Yeah couldn't agree more, and can't help but think it would have been addressed properly long ago, as an exposed option for "power users" if everything didn't switch to "just buy our subscription and stream everything".

My library is much smaller, 18,000 songs, 150 GB. From memory it took maybe a few hours to do the first 80%, I think I left it unattended but it could have been anywhere between 1 - 6 hours, my memory is fuzzy there. The second run that found the 20% remaining was much faster, under an hour, I think more like half an hour.

Biggest factor might be the disk though. My connection is to a NAS over 1Gb ethernet, but it's actually quite speedy for small read/write operations like searching through folders, which I guess is all it was doing. And library file itself for writing all local to the SSD, that's not stored on NAS.

16+ hours is a bit crazy. Does it allow you to quit in the normal way, without a Force Quit? If it does I'd restart Music and see if it picks up and does better on the second run. Not sure if I'd want to Force Quit, though my guess is worst case they'll all be "?" and you can click one to restart the process. Maybe would try making a copy of the Music lib/XML etc files before force quit.

Since writing that post I'm on the look out for a different music client altogether. something that ONLY does local music, no tie to any streaming service, which hopefully would mean it's reliable for that dedicated purpose. Not looked into enough to find something yet, though.
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
So as I just wrote here, this whole problem has kept me from buying a new Mac for years. Apple must figure out a way to deal with this problem! People need to move media files around, it's absurd there is no way to point iTunes at new paths (and multiple paths, not just one). Everything that was HERE is now HERE, and so forth as many times as needed.

Anyway -- I am in the process of doing as you described now. I have a 2TB MP3 library and iTunes (on Mojave) has been spinning now for 16 hours+. No sign of what it is doing other than Activity Monitor which is showing 38-42 open threads and occasionally showing as unresponsive but then waking back up.

How long did your "first run" take? How large is your library? Thank you.
reply above ^
 

woodenbrain

macrumors member
Sep 2, 2009
74
8
16+ hours is a bit crazy. Does it allow you to quit in the normal way, without a Force Quit? If it does I'd restart Music and see if it picks up and does better on the second run. Not sure if I'd want to Force Quit, though my guess is worst case they'll all be "?" and you can click one to restart the process. Maybe would try making a copy of the Music lib/XML etc files before force quit.
You've no idea. At the rate it's going, it's going to be a month. Granted, this is running on an old Mac (CPU upgraded 2009 MacPro); the files are now on the NAS. But the library file is on a directly-attached HDD. iTunes beachballs, but usually it's making progress. I can tell by the mod date of the .xml and .itl file. Every day I've been making a copy of the .xml file to check progress. so far after what, a week, it's 1/8 done. So 2 months?
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
****, yeah that's crazy. I can only guess it's nothing CPU related and a network bandwidth issue (I am on an M1 mac), or a "small read and write operations" bottleneck. I don't think it will be able to run that long, in any case, unless they're doing good RAM management. I'd quit the process and try again, or another route. Good luck! Like you say, this should be a simple feature built in.

You've no idea. At the rate it's going, it's going to be a month. Granted, this is running on an old Mac (CPU upgraded 2009 MacPro); the files are now on the NAS. But the library file is on a directly-attached HDD. iTunes beachballs, but usually it's making progress. I can tell by the mod date of the .xml and .itl file. Every day I've been making a copy of the .xml file to check progress. so far after what, a week, it's 1/8 done. So 2 months?
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
Thank you chinopozo for updating Music/iTunes/Library solutions. Many of us have all sorts of issues with these, because so many need to make transitions from external volumes with music files to migrate to newer macs and all kinds of issues come up. I myself have had issues (which I described and solved in a thread on the Audio section of MR), and I'm always on the lookout for folks dealing with this.

No problem! (just seen this) It's crazy there are not better solutions for this. I did speak with someone who manages their offline music collection through VLC today, and am going to look into that. Basically I think the real solution is to switch to a client dedicated to offline music collections.
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
Just to update here with something I found, as I have (again) had to do the same and move my music library from a NAS to an HDD (to get free backups via Backblaze, basically, and also eliminate the LAN to solve issues related to router) and I stumbled across a solution that let me do it in seconds.

What I found recently while doing loads of "trying to fix my damn music library" tasks over the last week is Music.app will update the "lost" status, or try to find songs, specifically when you add them to a playlist. When you try to add them to a list, it goes through every track and checks the location is there.

So if you move one album and just want to update that, make sure their old location is no longer available, select all, and try to add to a playlist. It will update all with the "lost" status then you can click one, Locate, and click "Find others". This is useful because it allows moving music in batches, basically — so you can do 1000 or 5000 at a time to make things more manageable.

And, the pretty amazing thing I just found that I came here to post. This won't work for all, but I highly recommend putting your music in a VOLUME called "Music" (or something that would always make sense to hold your audio collection, and nothing else). Inside the volume goes whatever folder structure you want and could be used over time. This is what I accidentally did, and it allows me to move 20,000 songs from NAS to HDD in about 5 minutes (it updated in seconds, it just take a few mins to check it actually did update).

Old path (NAS share) was "/music/Music/<artist folders here>/"

New path (new volume I made on HDD using Disk Utility) was "/MUSIC/Music/<artist folders here>/"

I moved everything to HDD, disconnected the NAS, selected about 5000 songs in Music.app, put them in a playlist, and clicked the first expecting it to ask me to Locate. Instead it just played, and all 5000 songs were updated (after a pause of about 10 seconds) to say "/MUSIC/" (caps, the new location on HDD).

Checked my library Songs view, other songs outside the 5000 added to list still said "/music/" via Get Info.

I repeated the same 4 times in batches of 5000, and they all updated literally the instant I dragged them into a new playlist. All say "MUSIC" now and it's all working perfectly.

Basically my takeaway is if you store your collection on an external device, create a Volume (with Disk Utility) on that device so it mounts to "/MUSIC" or whatever at the root level, with a predictable dir structure inside you won't want to change in the future.

The advantage is you can move your library in seconds to any future device (new NAS, new HDD, SSD, etc — you could probably even make a local volume as a partition of a mac's internal storage, though I've not done that before).

Anyway, hope that helps someone!
 

chinopozo

macrumors newbie
Dec 30, 2023
7
0
OK one more thing I just noticed!

If you store the music on an AFPS formatted volume, it APPEARS (test yourself carefully) that Music.app can just follow your music around without having to "Locate" when you change the folder structures.

I've noticed this a few times now, so if you re-organise or rename an album folder or track (not within Music.app, directly on the volume) Music.app knows what you did, and just updates the path without you telling it.

It definitely didn't do this on the NAS share, which was not formatted as AFPS.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.