I cleared all of the albums and playlists off my iPhone and restored it by syncing from my Mac in order to correct the apparently common problem of the album artwork getting scrambled when setting up an iPhone 12 by copying data from an older iPhone. However, before restoring the tracks, my Mac backward-synced the playlists in the Mac Music app from the phone, deleting all the ones I'd had on the phone. I've tried restoring iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, and iTunes Music Library.xml in the iTunes folder and Music Library in the Music folder from a time machine backup from before they were deleted, but the playlists are still gone when I reopen the Music app. Is there any way to get them back?
First do you have a subscription to either Apple Music or iTunes Match? Second do you have a specific date in mind for when your library was last correct? The old iTunes files aren't relevant if you're running Music. You should restore the Music Library.musiclibrary file from backup, taking your machine offline first if you have either Apple Music or iTunes Match, option-start Music to explicitly choose your restored library. If you have Apple Music or iTunes Match you now need to export your playlists as XML files, then you can go back online, allow the library to update to the current version in the cloud, then import your exported lists.
Thanks a lot! I didn't know about option-clicking the app, and that solved the problem when I did it.
You're welcome. 🙂