XML iTunes library file changing path by itself!

Friends - I have moved my iTunes library from one machine to the other several times over the years.. but I have never seen this happen:


When the path changes, I go into the Ituneslibrary.xml and do a find and replace and swap the old path string witht the new, save the file, open iTunes, and it can find all of my music.


This time, however... something weird is going on. I am swapping iTunes%20Media/Music with iTunes%20Media (because /Music is not part of the path and with that in there it can't find my content).... I save the file after the replaces are done.... I've checked under preferences and the path to all of my music is correct... so then I relaunch iTunes, go to play a song, and it says it cannot find it. I then close iTunes, go into the XML, do a "find" for that song, and I notice that iTunes is putting iTunes%20Media/Music back into the path.


I've verified this repeatedly. I AM saving the file after I switch iTunes%20Media/Music to iTunes%20Media.... and it literally is just throwing that extra /Music back in there by itself.


By the way, if I change the XML and save it when iTunes is open, it will find the songs... which tells me for sure that editing the XML is the right thing to do.


Appreciate any insight on this phantom path changer!!


Running Windows 8 Pro and latest version of iTunes

Other OS

Posted on Jan 26, 2013 6:55 AM

Reply
11 replies

Jan 26, 2013 8:54 AM in response to cfletcher1971

Hmm, hacking the XML file as part of a library migration should not be necessary. iTunes uses this file to support 3rd party apps, not to tell it where to find media. That data is stored in the iTunes Library.itl database.


Let's start with what I think you should have done...


These are two possible approaches that should work to move an existing iTunes library to a new computer.


Method 1

  1. Backup the library with this User Tip.
  2. Restore the backup to your new computer using the same tool used to back it up.
  3. Deauthorize the old computer if you no longer want to access protected content on it.
  4. Keep your backup up-to-date in future.


Method 2

Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.


Both methods should give the new computer a working clone of the library that was on the old one. As far as iTunes is concerned this is still the "home" library for your devices so you shouldn't have any issues with iTunes wanting to erase are reload.


I'd recommend method 1 since it establishes an ongoing backup for your library.


Should you be in the unfortunate position where computer has died with no backup then see Recover your iTunes library from your iPod or iOS device.


The standard method doesn't work so well if the media folder has been split to a new location so that it is no longer a sub-folder of the iTunes folder. In such cases one can either Make a split library portable or restore the media folder to exactly the same path.


When iTunes 9 was released it included a new structure for the library called, at the time, "iTunes Media Organization". This moved the location of certain media content within the library. Notably artist level folders moved to <Media Folder>\Music instead of <Media Folder>. I suspect your library is in the "pre-iTunes 9" layout but, because of the order in which you installed iTunes and migrated your library, iTunes "thinks" it is the newer layout.


Close iTunes. Inside your media folder is a hidden file .iTunes Preferences.plist. Open this with a text editor, change line 8 from

<integer>1</integer>

to

<integer>0</integer>

and save the change. Start iTunes. Should all be fixed.


I'd advise that you use Library > Organize Library > Rearrange files in the folder <Media Folder> to upgrade to the newer layout.


tt2

Jan 26, 2013 9:12 AM in response to turingtest2

Hi TT2, thanks for the dialog... you obviously know more about this application than most people.


Funny thing is, I already use Synctoy, have been for years, so we are like minded there. That is how I brought everything over. I changed the text of the .plist file to no avail.


Here's what I did: Modified the integer value of this file as you described.....

Opened the XML, changed the paths back to exclude the /Music part (which is not valid). saved the file, reopened it to make sure changes were saved.... it was good.


Open iTunes - click a song, it cannot find it....


Reopen the XML... ALL of the paths have had /Music added back in automatically.


Why is it doing this? If I could get it to stop doing this, I would then organize the library the way you describe here. But I can't... yet.....

Jan 26, 2013 9:36 AM in response to cfletcher1971

You really don't need to edit the XML. Download & run the script iTunesInfo which should output something a bit like this:


User uploaded file


I'm interested in the values of the first four lines. You can hide your username with <User> if it's in there. Also worth checking that Media Folder Location agrees with Edit > Preferences > Advanced. If not, let me know the value of that too.


tt2

Jan 26, 2013 10:38 AM in response to turingtest2

The preferences>Advanced location does match in the app and my directory structure.... so that's good. here is the tool output. So you can see here that this is actually correct.... \iTunes Media is indeed where everything is... and when I put it like that in the XML everything works. Then if you open and close iTunes it addes \Music to the end of the path and it breaks everything.... thanks for your continued help....


User uploaded fileXML ev

Jan 26, 2013 11:00 AM in response to turingtest2

OK, test library in "old" layout works fine when the media folder is "iTunes Music" or "iTunes Media".


There is another file that stores preferences that is sometimes implicated when things go wrong. The file iTunesPrefs.xml should be at:


C:\Documents and Settings\<User>\Application Data\Apple Computer\iTunes (Win XP)

or

C:\Users\<User>\AppData\Roaming\Apple Computer\iTunes (Later Windows)


With iTunes closed try renaming the file and then starting iTunes. It might behave this time.


Alternatively go with the flow and move your artists folders down into <Media Folder>\Music.


tt2

Mar 26, 2014 8:36 PM in response to cfletcher1971

My whole library went missing when my drive crashed. I recovered the files but to a different drive. I then re-added the new folder to the library. Then in the "songs" view I add the column Date Added an sorted by the date added an this grouped all the songs with the missing locations together so I could mass delete them from the Library.


Hope this helps......

Jul 28, 2014 4:32 PM in response to cfletcher1971

I had a similar problem, tried editing the XML, failed.


I had backed up the iTunes folder to external HDD because of drive errors, and was forced to use a new, smaller HDD for my system.


Usually I would have just copied back the iTunes folder, but I didn't have enough space for my music folder with my own sorting system.


So what I did was create a symlink (something like an alias, but on a deeper system level) pointing from ~/Music/my_own_music to the /my_own_music folder on my external HDD.


So:


- Copied the iTunes folder

- Open Terminal

sudo ln -s /Volumes/external/my_own_music/ ~/Music/my_own_music


You will have to change "external" for the name of your external HDD.

This creates a symlink in your home /Music folder called "my_own_music" that looks and behaves like a normal folder, but is really just a link to the correct folder on the external drive.

To remove a symlink use unlink ~/Music/my_own_music


iTunes now thinks all my files are on my internal HDD where they always were, altough they are really still on the external drive.

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.

XML iTunes library file changing path by itself!

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