External Hard Drive + Corrupt Apple Music Library + Rekordbox

Hi y'all!

I use an External HD to host all of my music files, and organize my playlists in Apple Music to sync with Rekordbox, for when I DJ.


Recently, I was working on music (I use Ableton, and also store files externally on this hard drive), and while I was trying to drag a track from Apple Music into Ableton to use as a reference, my hard drive froze.


Since then, my Music Library.musiclibrary file has been corrupted. A couple of notes:

  • All of my music files are still in the /iTunes/iTunes Media/Music folder
  • Right now I have a new Music Library created, and it is able to recognize songs from the Music folder, but the "Date Added" are all set to today's date (Mar 3, 2023)... This is not good, because I use the "Date Added" to sort my music from oldest to newest —> I would like to find a way to preserve the original "Date Added" metadata in the now corrupt Music Library.musiclibrary
  • I do have iTunes Match, and my iPhone is currently showing a relatively recent version of my playlists (I've heard you can turn on "Sync to Library", but I am afraid this will overwrite the cloud with my currently broken library, instead of downloading the preserved version)
  • When I open packaged content for the corrupt Music Library.musiclibrary, I am able to see Temp File.tmp that seems relatively recent (right before the crash). Is there any way I can use this to recover all of my Apple Music metadata?


In an ideal scenario I would like to be able to:

  1. Find a way to fix the corrupt Music Library.musicilbrary file (can First Aid with Disk Utility help with this?)
  2. Find a way to use the recent Temp File.tmp within the corrupt Music Library.musiclibrary package to recover the metadata
  3. As a last resort, use iTunes Match to recover my metadata


Would REALLY appreciate any help I can get! I have some gigs coming up, and will have to cancel them if I am unable to fix this :'(

Thank you so much!

Posted on Mar 23, 2023 11:19 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 24, 2023 3:32 PM

Library.musicdb becomes, for example, Not Library.musicdb


Copy and then paste Temp File.tmp (Cmd+C, Cmd+V) so the original is still there in case you need to revert to it, then rename the copy as Library.musicdb.


Launch Music and see what you get.



If you enable Sync Library in a new empty library it won't have any knowledge of your local media and will fill in all of the data from the cloud, playlists, date added, and other metadata as expected. If you actually have to download the cloud version of the library you have the occasional thing where you get the matched version of the song rather than your original copy, which may or may not be a particular issue for you. Not exactly sure what happens to date added if you try to import existing local files. Something I should check.


tt2

Similar questions

5 replies
Question marked as Top-ranking reply

Mar 24, 2023 3:32 PM in response to phantazn

Library.musicdb becomes, for example, Not Library.musicdb


Copy and then paste Temp File.tmp (Cmd+C, Cmd+V) so the original is still there in case you need to revert to it, then rename the copy as Library.musicdb.


Launch Music and see what you get.



If you enable Sync Library in a new empty library it won't have any knowledge of your local media and will fill in all of the data from the cloud, playlists, date added, and other metadata as expected. If you actually have to download the cloud version of the library you have the occasional thing where you get the matched version of the song rather than your original copy, which may or may not be a particular issue for you. Not exactly sure what happens to date added if you try to import existing local files. Something I should check.


tt2

Mar 24, 2023 2:49 PM in response to phantazn

See Empty/corrupt iTunes/Music library after upgrade/crash - Apple Community. You can try renaming Library.musicdb in the corrupt package and then copy & rename the Temp.tmp file and rename the copy as Library.musicdb. Then see if the library will open properly. I assume you don't currently have Time Machine set up such that it might backup the Music library on a regular basis.


You can option-start Music to create a separate library, in which you can enable Sync Library so you can see what is shown in the cloud version of the library. In principle you should be able to import local files and have them merge with the content in the cloud to avoid having to redownload everything.


tt2

Mar 24, 2023 10:48 PM in response to phantazn

Use Show Package Contents to look inside and manipulate the files as you would in any other folder.


You cannot import a .itl file. It can only be converted by using the option-start-Music method and then choosing the library, followed by choosing a location to save the converted Music library version. That should preserve date added. Perhaps you imported an XML file. That doesn't preserve date added but should restore playlists, etc.


Importing your existing files when they already show in the cloud resets date added, so that isn't the way to go. Hopefully renaming the .tmp file is going to work for you.


While maintaining different playlists in different libraries that all share a common media folder is possible, if the tracks have tags, then metadata changes you make in one library will eventually show up in another connected to the same file, although typically not until the file is played.


tt2

Mar 24, 2023 3:18 PM in response to turingtest2

Thank you! As of right now, this is what I see in my Music Library.musiclibrary package:


Given that Library.musicdb is 0 bytes, is that a red flag that it is not working? What should I name it to, is the idea that it would be replaced by Temp File.tmp -> (the new) Library.musicdb?


As of right now, my iPhone still has a working version of my original Music Library, but my Macbook does not. When enabling Sync Library, should I be concerned that that Macbook metadata will actually replace the iPhone's, and then I will have no copy of my original playlists, names, date added, and metadata?

Mar 24, 2023 4:31 PM in response to turingtest2

I see, a couple of follow-ups:


  • Library.musicdb and Temp File.tmp are both tucked into the Music Library.musiclibrary package. When I go to File -> Library -> Import Playlist, I'm only able to see Music Library.musiclibrary. In that case, am I supposed to take the (new) Library.musicdb out of the Music Library.musiclibrary package?
  • Can you help me understand how Apple Music leverages multiple Music Library.musiclibrary files? I have all of my .mp3s, .wavs, .aiffs, etc. in one consolidated "Music / iTunes Media" folder (which is where I direct the Music Media Location). When I imported an old iTunes Library.itl file, it found all of the music, but said the Date Added was today's date. Is the idea that I will always have one consolidated "Music / iTunes Media" folder, but then can have multiple Music Library.musiclibrary files, which would include the different metadatas + playlists structure?


I think understanding this will better help me know if the iTunes Match / iCloud scenario will work. I have all the files in my Media folder already, I would just need the cloud to sync all of the metadata and playlist organization for me.

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.

External Hard Drive + Corrupt Apple Music Library + Rekordbox

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