Go Back   MacRumors Forums > Apple Applications > Mac Applications and Mac App Store

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 14, 2008, 11:37 AM   #1
plab
macrumors newbie
 
Join Date: Nov 2008
iTunes won't restore all files from iTunes Music Library.xml

I had to move around my files recently so needed to change the location iTunes looked for them. I ran across a hack whereby you edit the iTunes Music Library.xml file and then intentionally corrupt the iTunes Library.itl file so that it reimports the next time you restart iTunes (I'm sure many of you may already be familiar with this hack).

It almost works.

Problem is that it doesn't import all my files. I have over 10000 files but it only imports 6445 of them. I noticed that the original xml filesize is 16MB. After importing, it gets chopped down to 10MB. What the heck is happening here?
plab is offline   0 Reply With Quote
Old Nov 15, 2008, 08:28 AM   #2
plab
Thread Starter
macrumors newbie
 
Join Date: Nov 2008
The plot thickens...

So I decided to try a different approach to my problem and here's how it went. First I deleted the xml and itl files in iTunes directory and fired it up. Basically, I'm working w/ a blank slate. I then went to File -> Library -> Import Playlist and selected the amended xml file. After churning along a bit, it spat out an error: The file "library.xml" cannot be imported. An unknown error occurred (-50).

So that's something I have to work off at least.
plab is offline   0 Reply With Quote
Old Nov 15, 2008, 10:54 AM   #3
plab
Thread Starter
macrumors newbie
 
Join Date: Nov 2008
Solved it

Finally, fixed this - posted in case anybody runs across the same issue. The import process was obviously bugging out on the import of one file, so all I basically did was remove the offending entry from the xml file. Figuring out which file to remove though was the only mildly tricky part. Here's how I did it.

Open your xml file and notice that the files are simply a bunch of 'key' tags followed by a 'dict' tag. The 'key' tag holds a number while the 'dict' tag encapsulates the actual metadata. The 'key' tag will be helpful for our purposes since as far as I can tell, it increments sequentially for each file. My 'key' tags started incrementing from 1316 - dunno why. Since I was only importing 6445 files before bugging out, I searched for the file corresponding to key 7761 (6445+1316).This got me real close to the bad file so from here it was only a matter of figuring out which file did not successfully import by comparing the xml file to iTunes. For me it was the file corresponding to key 7764. Anyway, I deleted the key and dict entry for key 7764, saved, reimported my library, and now all is fine.

As an aside, after restoring my library, I then went to import the single problematic file manually w/o any problem so although the issue is fixed, it's cause is still a mystery.
plab is offline   0 Reply With Quote
Old Mar 26, 2009, 04:51 AM   #4
pvd
macrumors newbie
 
Join Date: Mar 2009
Just had the same problem, this post was a godsend. Retained my dual music library folders. Thank you.
pvd is offline   0 Reply With Quote
Old Sep 8, 2011, 09:30 AM   #5
SWD
macrumors member
 
Join Date: May 2011
I had a different problem, but importing from the .xml file turned to be the solution. Then I came to this issue where I received this error message. I opened up the .xml file, followed your instructions for reading it and found the issue within the file. The file was missing in the library, but was reporting garbage text in the .xml file. I had access to export the library file again and it imported perfectly. Thanks for posting the solution.
SWD is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Applications > Mac Applications and Mac App Store

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
itunes moved and/or copied tons of music files, ruined my library. how can i reverse? ttppmm Mac Applications and Mac App Store 1 Sep 12, 2013 09:37 AM
iTunes can't play music from moved iTunes library (in TM backup) Cougarcat Mac Applications and Mac App Store 0 Aug 17, 2013 02:27 PM
iTunes music library.XML not updating??? Bronze84 Mac Applications and Mac App Store 1 Nov 1, 2012 04:38 AM
iTunes Music Library XML Problem dominickvaris OS X 0 Aug 9, 2012 11:44 PM
iTunes Match Files or copy Itunes Music Folder nortyhat OS X 10.8 Mountain Lion 0 Jul 26, 2012 02:56 PM

Forum Jump

All times are GMT -5. The time now is 08:06 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC