Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can I replace curent iTunes Music Library.xml with previous Windows based Library to restore some lost metadata?

Old Pc motherboard failed, not sure which iTunes version I was using, but was using Windows XP. I was able to recover the hard drive and transfer the files to my iMac using a USB external hard drive dock . All of the music was transferred to my iMac, however, I lost some of the metadata, (specifically, number of times played, last played, date added). Song names, genres, albums were all intact. Spent a few hours updating album covers to more high resolution (yes, I'm obsessive compulsive) since upgrading from a 15" screen to a 27". Is there any way to replace the current iTunes Library.xml file with the previous Windows based version, or will that really mess up the file directory? When I transferred my music, I transferred the entire windows iTunes file, so I do have the previous library.xml file, but am concerned that since it was Windows based that it may mess up the currently restored library? It would seem that the easy thing to do would be to remove the current iTunes Library.xml file and just put the previous windows based file it it's place, but I'm not sure that would mess the newly restored files or wouldn't associate with the files since they've been relocated and partially renamed? I spoke with Apple support and they were not sure if the library would be corrupted or not, so I'm not sure I want to start this process all over again.


I guess another alternative would be to transfer the old windows based iTunes to our Windows laptop and then transfer the files from the laptop based iTunes directly to my iMac through the migration assistant? Of course, If I do that, I'd likely have two copies of each song (I have over 5300) in the library and would have to delete the ones without the metadata and then spend more time updated the album covers again.


I'm not quite that compulsive.....


Any thoughts, ideas or suggestions would be appreciated.


Thanks : ))

iMac (27-inch Mid 2011), OS X Mavericks (10.9.5)

Posted on Mar 22, 2015 2:03 PM

Reply
Question marked as Best reply

Posted on Mar 22, 2015 2:38 PM

The important file is the .itl file, iTunes Library.itl. The .xml is provided for third party support. As a rule all you normally need to do is copy over the entire iTunes folder as a unit. If you copied the media previously then copy over the bits you left behind, e.g. the library files in the main iTunes folder and the Album Artwork and Previous iTunes Libraries folders.


See Make a split library portable for some general background.


See also Empty/corrupt iTunes library after upgrade/crash if the .itl file is missing from the main iTunes folder on the crashed drive.


tt2

41 replies
Question marked as Best reply

Mar 22, 2015 2:38 PM in response to Niwle

The important file is the .itl file, iTunes Library.itl. The .xml is provided for third party support. As a rule all you normally need to do is copy over the entire iTunes folder as a unit. If you copied the media previously then copy over the bits you left behind, e.g. the library files in the main iTunes folder and the Album Artwork and Previous iTunes Libraries folders.


See Make a split library portable for some general background.


See also Empty/corrupt iTunes library after upgrade/crash if the .itl file is missing from the main iTunes folder on the crashed drive.


tt2

Mar 22, 2015 9:27 PM in response to turingtest2

User uploaded file

Thanks for the quick reply. Here's what my iTunes looks like now: The blue highlighted iTunes folder is my previous entire windows based library. As you can see it contains the .itl file. I checked the new iTunes Media file and all of my transferred music IS located there as well. If it matters, I bought the iMac about a year ago and was running iTunes of both machines, so I had a few songs on the iMac, but the majority of the music was still on the PC. (Of course it had been on my to-do list for almost a year to transfer the files over to the iMac which was finally facilitated after the crash of my PC). So the current iTunes Media file has a mixture of old music and the new music now. If I understand correctly (a big assumption on my part !), I should simply add the "old" iTunes Library.itl from it's location in the blue highlighted iTunes folder and drag it to where the other "new" iTunes Library.itl file is? If that's the case, do I remove the current .itl file, or leave them both there? Of course I'm guessing the metadata from the "new" file would be lost if I removed it? If that's the case, that's OK, there are far more (5K+) songs in the old library file. Also, I believe that wouldn't affect my newly updated Album Art file that I worked many hours on, since the "old" Album artwork is a sub-file of the old iTunes file? One final question, if it appears that all my songs are located under the "new" iTunes Media file, do I even need to keep the blue highlighted iTunes file where it is, or can I just put it in the trash now?. It seems that there are two copies of each old song in the main iTunes file now? Thanks again for your time.

Mar 23, 2015 2:58 AM in response to Niwle

Hi,


If I understand correctly the items marked in red are your current active library files, and the items in blue are the library files retrieved from the Windows machine.


User uploaded file


Looking inside the old library folder I see you have both an iTunes Media folder and an iTunes Music folder which may complicate things. Is everything in ../Music/iTunes/iTunes/iTunes Media also in ../Music/iTunes/iTunes Media? Does iTunes Music contain unique content or is it another copy?


Start by making a copy of the blue iTunes Library.itl file as a backup, just in case.


You can review what is in the blue library by pressing and holding down option as you start iTunes. Keep holding until prompted to choose or create a library, then browse to the file ../Music/iTunes/iTunes/iTunes Library.itl. Opening the library from this path should result in it working with the media in the more deeply nested copy of the iTunes Media folder. Is this the version of your library that you want to work with and does it appear to work correctly? If so close it, move the red files/folder into a new empty folder called iTunes Temp, copy the blue files/folder up one level from ../Music/iTunes/iTunes into../Music/iTunes, then option start iTunes again and connect to ../Music/iTunes/iTunes Library.itl. This should now be your old database working with the less deeply nested version of iTunes Media. Check it is working. If needed the actions you've just taken could be reversed.

Assuming things are working properly you can use File > Add Folder to Library to add in the folder ../Music/iTunes/iTunes Media which will add in any content in the media folder that was unknown to the older library. This will come in with no ratings or play counts, but should have any embedded artwork. If you're happy that the library now has all of the content that you want in it you can move the iTunes Temp folder and the deeper version of the iTunes folder out to the desktop, make sure that hasn't broken anything in the library, then delete those two folders.

Regarding the artwork, you should end up with the files that have the updated artwork, but the cache is going to be based on the older version of the library. You can force iTunes to rebuild the cache based on the current embedded artwork by deleting the folder ../Music/iTunes/Album Artwork/Cache and then slowly scrolling through your library in the Albums view.


tt2

Mar 23, 2015 12:35 PM in response to turingtest2

Yes, things are a bit confusing! Unfortunately this isn't the first time I've lost my iTunes content. I have had to restore my music library twice in the past due to PC failures (I'm NEVER going back.....I love my iMac). Both times I restored the library directly from my iPod with third party software. That's why I have both an blue iTunes Music (first restore) and a blue iTunes Media file. To make things even more confusing, there is a "Music" folder inside the blue ITunes Media file.

User uploaded file


To answer your question, The blue iTunes Media and blue iTunes Music files have different content. When I loaded the blue .itl file, the information was all there, metadata and all! However, when I clicked on any song I get a message saying that iTunes cannot locate the original file, would you like to find it?I'm guessing I'd have to locate each song (file) individually by searching in the new iTunes Media file to attach the metadata from it? I'm almost thinking it might just be easier to remove the entire blue iTunes folder from the previous library since it appear everything is located under the new iTunes Media subfolder of iTunes. Or just leave well enough alone and do without the old metadata. Thanks again 😁

Mar 23, 2015 4:51 PM in response to Niwle

I have several tools for fixing broken links or retrieving data from old library files, but they all run in Windows. 😟


You could try the steps of backing up the red files, then moving the blues files into the main iTunes folder. Then use Get Info on a broken link, locate the missing file when prompted. Once you've done this iTunes should offer to fix any other broken links. As long as iTunes has been managing your files in that media folder then it should do a reasonable job.


If it doesn't pay off you can switch the files back again.


tt2

Mar 23, 2015 11:00 PM in response to turingtest2

"There's the rub", I was not using iTunes to manage my files in my previous libraries (quite obvious, since it's an utter mess). That is probably the death knell for merging the metadata without spending way more time than it's worth. After working on it for the past few days, I think I'm OK with letting it go : )). Since it appears that the current iTunes Media file is now being managed by iTunes and has all my music on it, should I just trash the old "blue" iTunes file, it seems that it's just a duplicate copy?

Mar 25, 2015 11:14 AM in response to turingtest2

Making progress !!,


As you suggested, I used the option upon startup and loaded the old "Blue" version on my iTunes, clicked one one song which generated the "iTunes cannot locate the original file, would you like to find it?" message. After manually locating one song, iTunes worked it's magic and found all of the rest of the files and was working normally as you said with the "old" library. So just to verify, my next step is to:

User uploaded file

1. Move the above 5 circled "red" files to a new "iTunes Temp" folder.

2. Copy (not drag? or does it matter?) the old "blue" "iTunes folder sandwiched in between the red "Album Artwork" and the red "library" files to the first iTunes folder just after music (the one grouped with the Amazon Mp3, Audio Music Apps and GarageBand files. Will this action create two "iTunes" folders at the location, since there is already one there? Will the computer rename it "iTunes.x" or something like that, or ask me if I want to replace the other one?


3. Hold the option key, start iTunes and then connect it to Music/iTunes/iTuneslibrary.itl. I"m guessing that file will be generated when I move the new copied iTunes folder in place, since we've moved the "red" library files to " iTunes Temp" ?


My last question now is, if I use File > Add Folder to Library to add in the folder ../Music/iTunes/iTunes Media will that not result in duplicate copies of all of the old folders since the Media folder is a complete library? Or will it prompt me to disregard all duplicates and only add files without copies?


If it all goes well, I understand I can remove the temp files and deeper versions of iTunes first to the desktop and if everything is still working after that to the trash bin?


Just want to be sure before I proceed.


Thanks again so much for your time and patience, I really appreciate the assistance.

Mar 25, 2015 11:48 AM in response to Niwle

  1. Yes, make a new temporary folder for the red set of library files you're going to discard later, just in case there is any need to retrace your steps.
  2. I recommend copying instead of moving the blue set for the same reasons, if something goes wrong you can revert to the library you've just repaired. You're going to copy one folder and four files from ..Music/iTunes/iTunes up into ../Music/iTunes/ - nothing needs to be overwritten, nor should anything be automatically renamed. That said either skip copying the .xml files (you've probably got a new one called iTunes Library.xml now) or copy the newer one but rename it as iTunes Music Library.xml as this is the name iTunes will use for the file when it is located in the standard path of ../Music/iTunes/.
  3. Having copied the library files up one level there will be an iTunes Library.itl in the correct folder. You've moved the red library into temp and copied the blue files into the folder where the red ones used to be.


All the older copies of your media are nested inside ..Music/iTunes/iTuneswhich runs parallel to ..Music/iTunes/iTunes Media and is not contained within it, so adding iTunes Media to the library should be safe and should just collect any recent additions to the library not known to your old set of library files. Feel free to move the more deeply nested iTunes folder into the iTunes Temp folder you made, and move that out to the desktop before you do the add folder step.


tt2

Mar 25, 2015 1:08 PM in response to turingtest2

Another (surprise!) question: more a procedural type: If I want to copy the old "blue" iTunes file, it will copy everything, do I just delete the files I don't need in the copied version:

User uploaded file

So once the copy is made I can delete ALL the subfiles except for Album Artwork, and the iTunes Library Extras.itdb, iTunes Library Genius.itdb and iTunes Libray.itl ? Or is there a way to copy just the subfolders I need and the main folder?


Thanks.......again.

Mar 25, 2015 1:23 PM in response to Niwle

STOP!


Niwle wrote:


Another (surprise!) question: more a procedural type: If I want to copy the old "blue" iTunes file, it will copy everything, do I just delete the files I don't need in the copied version:

No! 😮


If you copy a folder on top of another folder on a Mac one replaces the other. THIS IS NOT WHAT YOU WANT TO DO. In Windows you would be prompted to merge the data, but that isn't right either. All of the media you want your library to use is in ../Music/iTunes/iTunes Media. We don't want to damage that folder at this point.


Just copy the files & folder highlighted in blue. Specifically copy these:

Album Artwork (Folder)

iTunes Library.itl

iTunes Library Extras.itdb

iTunes Library Genius.itdb

From ../Music/iTunes/iTunes up one level into ../Music/iTunes (which should no longer contain any files or folders with those names). Ignore the .xml files, iTunes will remake one automatically.


Once you have copied the files to the higher level you can option-start-iTunes to access the database on the "correct" path, ../Music/iTunes/iTunes Library.itl.


tt2

Can I replace curent iTunes Music Library.xml with previous Windows based Library to restore some lost metadata?

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