lgarron / first-world

Issues that are not necessarily easy to report/fix, and are (generally) not a matter of life-or-death.
https://github.com/lgarron/first-world/issues
0 stars 0 forks source link

Restoring playlist from `Music.app` backups is an arduous, manual mess. #114

Open lgarron opened 2 years ago

lgarron commented 2 years ago

Splitting this out from https://github.com/lgarron/first-world/issues/110#issuecomment-1140427233

It's still really easy to delete a playlist with no practical way to restore it.

I have lots of backups of my iTunes/Music.app library. I export the XML format once per month by hand. However, I'm currently trying to restore a particular playlist (infuriatingly deleted due to the issue that led me to finally file #110), and it's a mess.

Using a backed-up Music Library.musiclibrary package:

Apple doesn't have documentation for this. The closest is https://support.apple.com/en-us/HT201625, which:

I'm going to look for tools to decode the contents of Music Library.musiclibrary (Library.musicdb in particular), we'll see how that goes. If that succeeds, it's probably only another 2-3 hours to actually reconstruct the playlist. 🤷

lgarron commented 2 years ago

I'm going to look for tools to decode the contents of Music Library.musiclibrary (Library.musicdb in particular), we'll see how that goes.

First step:

https://github.com/rinsuki-lab/musicdb-format/tree/master/HexFiend_BinaryTemplates

lgarron commented 2 years ago
  • Trying to open the .musiclibrary package in a fresh user account result in this (note: in this screenshot, the current user account is the owner of the package and its contents, so write permissions shouldn't be the actual issue):

Okay, I tried this a few times and it finally worked.

Turns out that Finder was showing deceptive info about the file permissions, but I think that may have actually helped me. Specifically, I was able to get Music.app to load the database long enough to take some screenshots and also run "Export > Playlist", although the .m3u8 export ended up truncated and corrupted.