Accidentally changed the name of every album and album artist in my Apple Music to the same name on my Mac. Restoring the Music folder on Time Machine fixed nothing

I was renaming and album and I guess I didn't realize that I had my whole library selected (~700 albums) and renamed every one of them to the same name. It seems there's no way to revert this so I really don't know what to do. Any help would be great.

MacBook Pro with Touch Bar

Posted on Jun 21, 2022 5:57 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 21, 2022 7:17 PM

Do you have a subscription to either Apple Music or iTunes Match? These services would affect your ability to restore the library from Time Machine. After restoring the Music folder from Time Machine it may pay to hold down option and use the option to choose a library, then choose the restored Music Library.musiclibrary file. If you have a subscription then the changes you made will likely have been uploaded to the cloud, and will be reapplied to the library when it connects to your iCloud Music Library. I may have a scripting solution for you if needed that lets you export the details from the old library, then import this data to the active library.


tt2

Similar questions

13 replies
Question marked as Top-ranking reply

Jun 21, 2022 7:17 PM in response to skngh

Do you have a subscription to either Apple Music or iTunes Match? These services would affect your ability to restore the library from Time Machine. After restoring the Music folder from Time Machine it may pay to hold down option and use the option to choose a library, then choose the restored Music Library.musiclibrary file. If you have a subscription then the changes you made will likely have been uploaded to the cloud, and will be reapplied to the library when it connects to your iCloud Music Library. I may have a scripting solution for you if needed that lets you export the details from the old library, then import this data to the active library.


tt2

Jun 22, 2022 7:40 AM in response to skngh

If you've read up on the ExportImport script you should have a general idea of what these two scripts do. They can be downloaded as ExportMusicMetadata.zip and ImportMusicMetadata.zip. Unpack the zip files and put the scripts in your downloads folder, or on the desktop, or see https://dougscripts.com/itunes/itinfo/downloadfaqmx.php to allow them to be run from the Music menu bar. The first script will create a text file for selected tracks that exports a number of properties, the second lets you select a text file and it will read in the properties for each track, updating the library where they are different. They were written last August, but I cannot find a related thread where I might have gone into more detail. I assume I wrote them for someone else's benefit but perhaps not.


A quick test last night confirmed I can edit data for a selection of tracks, modify the exported data, and import it updating the tracks as intended. In particular Album and Album Artists are among the fields that are exported and imported.


In your case you want to take your computer off line, restore a pre-corruption backup of your entire music folder, export the metadata for all affected tracks, connect to the Internet and let iCloud Music Library update, which will copy back all of the unwanted changes, then use the import script to reapply the saved data.


tt2

Jun 23, 2022 11:51 AM in response to skngh

Option-start-Music and create a new empty library. Check to see if the bogus album still exists in the cloud. If so delete it. Otherwise on the iPhone turn off Sync Library, then try Settings > General > iPhone Storage > Music > Edit > All Songs > Delete, then turn Sync Library back on.


Did you identify the track that was causing a problem during export, and if so anything obviously different about it from other tracks?


The "read file srcFile as «class utf8»" error was an odd one. I'd tested the script on Catalina through Monterey and not seen that one, but if the as clause is redundant I can remove it.


tt2

Jun 22, 2022 3:46 PM in response to espressoexcess

Rats. I wonder what is causing that? I assume you're still in export mode at this point in time. Do you have any cloud items in the selection? Could you try using the Songs view of the library sorted as album by artist, then select roughly 300 tracks and see if they will export, then the next 30 or so and see if you can export those, then try to narrow down to the actual track that causes a problem and see if you can get some details for that track. I'll think about what I can do in the way of graceful fallback when a property cannot be read. You might be able to get most of the data exported in a number of separate files. There shouldn't be any problem importing in multiple batches (assuming no other bugs I'm unaware of) but it would be nice to isolate the cause of the failure above.


tt2

Jun 23, 2022 12:55 PM in response to turingtest2

I re-enabled the "try" and "end try" lines and the export succeeded. Doesn't matter to me if a few tracks here or there are wrong, I just need to get "album artist" and "album name" (the fields I hammered) restored to their original versions on around 17k tracks.


Now working on the import, looks like I need to get rid of "as «class utf8»" as noted below.

Jun 23, 2022 7:14 PM in response to turingtest2

Ok now it's working like a charm with the edits to "try/end try" and "as «class utf8»" literally watching all my mangled & cloud synced tracks restore their album and artist names, one at a time...


There were a handful of problem tracks omitted by the "try" block, but only a dozen or so out of 17k. International albums with weird characters and accent marks, etc.

Jun 23, 2022 7:36 PM in response to turingtest2

Fixed mine! Seems the problem with my phone was that I didn't let the Music app on my mac sit open long enough for the changes to go to the cloud, so eventually about half of them reverted and all albums were split in half. I then just ran the import script again and waited for awhile longer after until I noticed all the changes on my phone. Thank you so much for all your help!

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.

Accidentally changed the name of every album and album artist in my Apple Music to the same name on my Mac. Restoring the Music folder on Time Machine fixed nothing

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