Apple Event: May 7th at 7 am PT

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

Mar 28, 2015 11:24 AM in response to Niwle

OK,


I was away from the desktop for a few days, here's what I done so far:


User uploaded file


I noticed an extra "iTunes Library.xml" file in the temporary file after moving the files to the new location, I guess that shouldn't matter, since it'll be deleted once we link the new library.


User uploaded file


I've copied the four files up one level into the iTunes folder:

Album Artwork (Folder)

iTunes Library.itl

iTunes Library Extras.itdb

iTunes Library Genius.itdb and have ignored the .xml files.


It all made sense after I had some time to think about what we are doing, I was concerned about copying the actual files that contained the music, which is not what we're doing, we're copying the directory of where to find them in the properly organized new iTunes Media folder. If it all looks good to you, then all I have left to do is option start iTunes and link it to the Music/iTunes/iTunes Library.itl folder and it should sort itself out.


Thanks,

Mar 28, 2015 12:42 PM in response to turingtest2

OK, I screwed something up : ((


Performed all the above actions, everything worked fine. Original library and metadata loaded. Went to add the content from the Media folder and now have duplicates of the original library and one copy of the new music.


In iTunes is used File>Add to Library>and used the new iTunes Media file:


User uploaded file

What did I do wrong and can I fix it?

Mar 28, 2015 1:12 PM in response to Niwle

Could I move the "iTunes Temp" file to the desktop, try to open iTunes and when it tell me it can't find the temp files, group the lost files together in iTunes by the ✖ (or whatever symbol appears), assuming they can be grouped that way and just mass delete them by selecting all, edit, delete?

Mar 28, 2015 1:27 PM in response to Niwle

Hmm. OK. Close iTunes


Copy the database files:

Album Artwork (Folder)

iTunes Library.itl

iTunes Library Extras.itdb

iTunes Library Genius.itdb

from ../Music/iTunes/iTunes up one level into ../Music/iTunes


You can allow the copied files/folders to overwrite what is already there.


(Isn't a good job we didn't move them the first time around?)


Now start iTunes and check everything is working. In particular check the location of the media folder under Edit > Preferences > Advanced is correctly pointed at ../Music/iTunes/iTunes Media


Close iTunes.

Reopen it.

The library should be clear of duplicates, and working. Check that content plays.


Are there duplicates within the iTunes library?

Are there duplicates within the media folder?

Look inside a typical folder ..Music/iTunes/iTunes Media/<Artist>/<Album>, is there more than one copy of each track?


Do you recall which folder you selected to import? The folder ..Music/iTunes still contains iTunes Temp which you have yet to move to the desktop. You should have imported ..Music/iTunes/iTunes Media. (Good job we turned off Keep & Copy too.)


tt2

Mar 28, 2015 9:15 PM in response to turingtest2

So close, yet so far......


OK, here's where were at:


The good news, I can still load the entire current library from the iTunes/iTunes Temp/iTunes Library.itl file. Of course it is as we left it, the entire library without the "old" metadata. So at worst, we can return to where I began.


I can load the "old" library with the correct metadata when I option start iTunes and use the Music>iTunes>iTunes Library.itl file. There are no duplicates, it's just the old library without the newer songs that were in the iMac library. HOWEVER, the file location doesn't appear to be correct:


User uploaded file


I have a sneaking suspicion on what may be the culprit: When the "old" library is option loaded into iTunes, the preferences are set as below:


"Keep iTunes Media folder organized" and "Copy files to iTunes Media folder when adding to library" are both unchecked, which was the setting I was using under the "old" PC library.


User uploaded file




When I option load the iTunes Temp .itl file, the preferences are set like this below:


User uploaded file

Obviously there's a discrepancy in the settings between the versions. My question now is, what steps do you suggest I take to now straighten this out?


Should I option load the "old" library under Music/iTunes/iTunes Library.itl


User uploaded file

Then open up preferences and change the settings and check the "Keep iTunes Media Folder Organized" box? Should I leave the "Copy files to iTunes Media folder when adding to library" unchecked or should I check them both? Once those boxes are checked, do I exit iTunes and restart it? I'm hoping that by checking the "Keep ITunes Media folder organzied" box, the music will all be in the correct file (Music/iTunes/iTunesMedia). I'm taking baby steps at this point to make sure I get it right. I'm not sure how to proceed, but I guess the good news is, I have that iTunes Temp folder to fall back on.


I can't thank you enough for your time, this is WAY more challenging than I had ever thought.

Mar 29, 2015 1:59 AM in response to Niwle

Whichever library is loaded we want to avoid moving or copying any media files at this stage, so you want to untick Keep... and Copy... in both cases.


Your properly organized media folder is the one at /Users/scottbrown/Music/iTunes/iTunes Media so again, whichever library you have open you want that to be designated media folder. If you change the media folder setting you don't want iTunes to consolidate any files.


The correct location for your active library file with respect to the media is /Users/scottbrown/Music/iTunes/iTunes Library.itl.


If you can get the database file with the correct metadata, in the correct location, with the correct media folder selected, then it ought to work, but if it isn't seeing the files then you can use the Get Info > Locate missing file > Repair other broken files process as before to fix the broken links.


E.g.

User uploaded file


Click Locate, then browse to and open the relevant file which should result in this box:

User uploaded file


Click Find Files, and then hopefully after a while you will be presented with this:

User uploaded file



tt2

Mar 29, 2015 5:14 PM in response to turingtest2

OK, this is what I have now:


I'm using the Music/iTunes/iTunes Libray .itl file for the iTunes Library.


User uploaded file



This is the "old" PC library, without the new music on the iMac.


I've unchecked both "Keep iTunes Media folder organized" and "Copy files to iTunes Media folder when adding to library". The iTunes Media folder location is


/users/scottbrown/Music/iTunes/iTunes Media

User uploaded file


So as you stated: "Your properly organized media folder is the one at /Users/scottbrown/Music/iTunes/iTunes Media"


So that is correct.


You also stated "The correct location for your active library file with respect to the media is /Users/scottbrown/Music/iTunes/iTunes Library.itl."


That is the library I loaded as the .itl file, NOT the version from the iTunes Temp file. So that should be correct.


This is what (of many things) are confusing me: when I get information on the songs listed in the iTunes library, with the correct metadata, this is the location of the songs that I see. As you can see it's showing that it's coming from the iTunes Temp location, that can't be correct can it? Because we are going to delete the iTunes Temp folder after it accessed the song from the properly organized "Media" location? I just can't figure out why the file location is listed as the temporary location when clearly the above setting says "Music/iTunes/iTunes Media" ?


User uploaded file


Now, one of the "new" songs from the iMac library NOT included in the library is located here:


User uploaded file

When I click on on of the songs from that file, it appears in the library and plays, and it of course shows the "Media" file location. Now, if I click on a song that is already located in the library and click on it, it "adds" the duplicate file, because the source file for the library file is showing iTunes Temp, not iTunes Media. So I'm not sure how to proceed? Do I have to hand pick each missing song from the library and add them individually? That would get them all into the library, but I would still have two full libraries (iTunes Media and would have to keep the iTunes Temp file in there as well because the majority of the library is using that location as the route?


I'm getting close to the point of defaulting back to the starting point, all the songs located properly in iTunes Media and just giving up hope of merging the old data. I've taken up far too much of your time. If you have any ideas, of course, I'll try them : ))


Thanks

Mar 29, 2015 5:50 PM in response to Niwle

Close iTunes.

Move iTunes Temp to your desktop.

Start iTunes.

Hopefully this time the existing entries either show as broken, and can be repaired, or now point to the files inside the correct iTunes Media folder.

If that still doesn't work you could backup the folder on to an external drive which you then remove before firing up the library, or assume you know that you have all the content safe in iTunes Media, so delete and trash iTunes Temp.

tt2

Mar 29, 2015 7:19 PM in response to turingtest2

This machine is too smart for that 🙂


When I moved the files to my desktop, it immediately opened up and simply changed the file from:


Music/iTunes/iTunes Media to Music/iTunes/Desktop and found 'em all 👿


Actually it even found a few songs by finding them in the trash believe it or not, the file ended up with /trash/.....


???

Mar 29, 2015 7:53 PM in response to Niwle

You know, at this point (as I stated at the beginning of this mess....) I'm just glad I have ALL of my music in iTunes (Media). I am fine at this point and conceding complete and utter defeat about the metadata.


In order to restore my library to back to what will be the new normal, what steps should I take?


Do I delete the current library files under Music/iTunes/

Album Artwork (Folder)

iTunes Library.itl

iTunes Library Extras.itdb

iTunes Library Genius.itdb files, which are the "old" library files and replace them with the same named files from the iTunes Temp folder. Then just delete the whole iTunes Temp file, since it has the "old" file in it. (I still have a copy of the "old" library on an external drive if I ever need it)


I'm definitely ready to let it go.


Thanks 🙂

Mar 29, 2015 8:02 PM in response to Niwle

Or is it as simple as just changing the iTunes Media folder location to Music/iTunes/iTunes Media and then rechecking both the boxes below to keep iTunes organized and copy Media folder when adding. Once I have done that and double checked that everything is in it's place, trashing the whole "iTunes Temp" file?


That would be too easy !!



User uploaded file

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.