Rebuilding my Music library from scratch

Just want to see if my plan is any good.


After upgraded from High Sierra to Big Sur on my Mac mini, Music upgraded my iTunes library and it’s been problematic. Many album arts don’t show, some changes made are not remembered, etc. I’ve been troubleshooting more or less continuously, and this community is of great help, especially from contributions by turingtest2. But I want this nonsense to stop. My plan is to spend a few days to rebuild my library from scatch with a simple setup and hopefully resolve these problems once and for all.


My goal is to build a new Music folder on an external drive, fully self contained and ready to be used by any Mac to play songs, sync songs to an iPhone, and clone for backup. No more reliance on a seperate iTunes folder, external song files, artwork, etc. 


I have 1000 albums, 17,000 tracks, totalling 450GB. Most are imported from CDs as Apple lossless m4a files. I have added custom metadata (track name, composer, grouping, etc.), custom cover art, ratings to these files.


Kindly let me know if these steps are any good:

  1. Keep my original High Sierra iTunes folder (pre-Music) as a safe copy.
  2. In Music, export library as XML file, so that all my playlists can be recreated later on. (Despite other mess with Music, my playlists are good.)
  3. Use Mac mini Big Sur Disk Utility to erase and format an external HDD drive (HFS+, ignore ownership).
  4. Launch Music, create a new Music library stored on the external drive (verify I have “owner” permission to this folder).
  5. Set preference to “Keep Music Media folder organized” and uncheck “Automatically update artwork”.
  6. Choose File/Import to import music from my High Sierra iTunes folder (inside iTunes Music/Music). I expect Music to make a copy of all the songs and store them inside the new Music Library.musiclibrary package. Perhaps do this in small chunks. When completed I should see all songs in my library.
  7. Import the Library.xml file created earlier to recreate all my playlists. 
  8. My expectation is the old iTunes folder should no longer be needed. Going forward all media, database, (may be artwork cache as well?) live inside the self-contained Music Library.musiclibrary package. Any Macs with the same version of Music can plug this drive in and play the music.


I think my song ratings may not survive using this method. What I’ve done is I’ve created 5 (non-smart) playlists, each playlist contains all my songs that are 1 star, 2 star ... 5 star. These playlists are part of the Library.xml file exported. Hopefully when I import this xml file into the new library, I will see these 5 playlists, where I can select all tracks within each playlist and rate them accordingly. 

Mac mini, macOS 11.2

Posted on Mar 10, 2021 10:45 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 11, 2021 2:26 PM

Hi Derek,


When importing an XML playlist as a means of rebuilding a library it is necessary for the files to be at the paths that were saved in the XML. I can see your steps 5 and 6 potentially causing problems here, with files either not being where they're expected to be, or the import generating duplicates.


Assuming you're able to start with a working version of your iTunes library in High Sierra (multiboot or two systems?) then I'd try the following approach with a newly connected external drive we'll call External:


  1. With iTunes closed copy the following folder and files from your iTunes folder into a new folder called /External/Music - Album Artwork, iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, and sentinel (hidden).
  2. Now press and hold down Option as you launch iTunes. Keep holding until asked to choose or create a library. Click Choose and then browse to and open the library file External/Music/iTunes Library.itl.
  3. Under iTunes > Preferences > Advanced click the Change button and set the media folder to /External/Music/Media.
  4. iTunes should say "Would you like iTunes to move and rename the files in your new iTunes Media folder to match the “Keep iTunes Media folder organised” preference?" Click No, there is nothing there to organize at this point.
  5. Use File > Library > Organize Library > Consolidate Files and click OK.
  6. When iTunes has finished copying files your original library is untouched, while the External drive has a copy that is prepared for migrating into Music.
  7. Start in Big Sur. Option-start-Music and select the library file /External/Music/iTunes Library.itl.
  8. You'll be prompted to save the converted library in a folder. Use /External/Music 2.
  9. Close Music, move the file Music Library.musiclibrary from /External/Music 2 into /External/Music.
  10. Use Music > Preferences > Files to reset the media folder to /External/Music/Media.


The library should be in the right shape to move between computers running Big Sur and can be backed up to another drive for security. You can leave the iTunes files and Album Artwork folder in place in case you need to access your library on an older system, but be aware it will gradually get out of date with respect to the contents of the media folder as you add tracks or make changes.


Unlike iTunes the Music app doesn't store its album artwork cache in the library folder, and it has proved to be slow populating in some cases. Hopefully this new attempt to migrate your library will fare better.


Don't try to make metadata changes in Music while using AirPlay, they don't seem to save properly.


tt2



Similar questions

3 replies
Question marked as Top-ranking reply

Mar 11, 2021 2:26 PM in response to derekww

Hi Derek,


When importing an XML playlist as a means of rebuilding a library it is necessary for the files to be at the paths that were saved in the XML. I can see your steps 5 and 6 potentially causing problems here, with files either not being where they're expected to be, or the import generating duplicates.


Assuming you're able to start with a working version of your iTunes library in High Sierra (multiboot or two systems?) then I'd try the following approach with a newly connected external drive we'll call External:


  1. With iTunes closed copy the following folder and files from your iTunes folder into a new folder called /External/Music - Album Artwork, iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, and sentinel (hidden).
  2. Now press and hold down Option as you launch iTunes. Keep holding until asked to choose or create a library. Click Choose and then browse to and open the library file External/Music/iTunes Library.itl.
  3. Under iTunes > Preferences > Advanced click the Change button and set the media folder to /External/Music/Media.
  4. iTunes should say "Would you like iTunes to move and rename the files in your new iTunes Media folder to match the “Keep iTunes Media folder organised” preference?" Click No, there is nothing there to organize at this point.
  5. Use File > Library > Organize Library > Consolidate Files and click OK.
  6. When iTunes has finished copying files your original library is untouched, while the External drive has a copy that is prepared for migrating into Music.
  7. Start in Big Sur. Option-start-Music and select the library file /External/Music/iTunes Library.itl.
  8. You'll be prompted to save the converted library in a folder. Use /External/Music 2.
  9. Close Music, move the file Music Library.musiclibrary from /External/Music 2 into /External/Music.
  10. Use Music > Preferences > Files to reset the media folder to /External/Music/Media.


The library should be in the right shape to move between computers running Big Sur and can be backed up to another drive for security. You can leave the iTunes files and Album Artwork folder in place in case you need to access your library on an older system, but be aware it will gradually get out of date with respect to the contents of the media folder as you add tracks or make changes.


Unlike iTunes the Music app doesn't store its album artwork cache in the library folder, and it has proved to be slow populating in some cases. Hopefully this new attempt to migrate your library will fare better.


Don't try to make metadata changes in Music while using AirPlay, they don't seem to save properly.


tt2



Mar 12, 2021 12:33 PM in response to turingtest2

You accurately predicted my problem. When I import the Library.xml file to recreate all my playlists, no playlists were recreated because, as you said, the xml file records playlist of songs identified by their directory paths. Now that my entire library is recreated by importing all songs into Music, the files are stored in another directory.


I did not use your proposed solution however. I left all the song files where Music saved them to. Instead, I opened the Library.xml file in a text editor and used Find & Replace to replace all instances of the song paths to the new path (removing the last part of the path that describes the artist and song). In my particular case the old and new paths are:


Find: file:///Volumes/Casa%20HD/Derek%20Folder/iTunes/iTunes%20Music/

Replace with: file:///Volumes/Casa%20HD/Derek%20Folder/Music/Media.localized/


To get the exact new path that Music uses, I created a dummy playlist with one song. Export that playlist in xml. Open the xml file in a text editor and copy the exact file name minus the last part of the path that describes the artist folder and song name. This worked and now I got all my playlist back. If it wasn't for you telling me that the xml file relies on directory paths to identify songs, I might have assumed my xml files are useless. Thank you so much! I think I'm quite close to the finish line. When the dusts settled, I will share what I experienced with carrying out the above steps on rebuilding my library in Music.

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.

Rebuilding my Music library from scratch

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