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

How to edit iTunes database outside of iTunes

Hello everyone,

After a successfull (more or less) migration of my user account in Windows, I've found myself with a small problem concerning iTunes. The "My Music" folder of the user account was tranferred including the iTunes database & its Library folder. Outside of this folder I had another folder (located in D:\multimedia\lossless) which was also added to the iTunes database & now this folder is in E:\multimedia\lossless).

A lot of songs contained in that external folder are used in playlists & I have stats & ratings on them that I don't want to lose. With that being said, how could I modify the iTunes database (after a careful backup of course) so that every occurence of the path d:\multimedia\lossless could be changed into the new location e:\multimedia\lossless ?

I really need help on this so thanks in advance so anyone who could help. 🙂

MacBook Pro 2.4GHz (15"4) 4096MB PC5300 DDR-II, Mac OS X (10.6), 80GB iPod Classic (black) - 8GB iPod nano (Chromatic blue) - 16GB iPhone (white)

Posted on May 24, 2010 10:37 AM

Reply
Question marked as Best reply

Posted on May 24, 2010 10:59 AM

You can edit the iTunes Library.xml file and use the edited XML file to rebuild the ITL database.
This will keep all metadata except Date Added.
If you care about Date Added, your only option is to re-link the files one-by-one.



iTunes has to have an ITL file to open & run. There are 3 ways it gets one:
1) If no ITL file exists, it creates a new one (blank library)
2) If it finds an existing ITL, it uses it and ignores the XML file.
3) If it finds a damaged ITL, it looks for an XML file and tries to rebuild the ITL from that.




You need to edit the XML file and replace all the paths from D: to E:.
Then damage the itl. Open it in WordPad, select everything, and hit delete. Save it with zero bytes (nothing) in it.
This will force itunes to re-create it by looking at the XML file.



Like you said, be sure to make backup before doing this.
6 replies
Question marked as Best reply

May 24, 2010 10:59 AM in response to Didou

You can edit the iTunes Library.xml file and use the edited XML file to rebuild the ITL database.
This will keep all metadata except Date Added.
If you care about Date Added, your only option is to re-link the files one-by-one.



iTunes has to have an ITL file to open & run. There are 3 ways it gets one:
1) If no ITL file exists, it creates a new one (blank library)
2) If it finds an existing ITL, it uses it and ignores the XML file.
3) If it finds a damaged ITL, it looks for an XML file and tries to rebuild the ITL from that.




You need to edit the XML file and replace all the paths from D: to E:.
Then damage the itl. Open it in WordPad, select everything, and hit delete. Save it with zero bytes (nothing) in it.
This will force itunes to re-create it by looking at the XML file.



Like you said, be sure to make backup before doing this.

May 24, 2010 11:18 AM in response to Didou

You can't edit the iTunes database directly. Which version of Windows are we talking about here? Can you move them back to D:\multimedia\lossless\, at least temporarily? iTunes reports the location of "missing" files as "unavailible" which makes it hard to write a script which does a search & replace on the missing files. I do however have a script which will move things that can be found to a new location and updates iTunes as it goes, thereby preserving all metadata.

An alternative possiblity would be to create a "junction" so that D:\multimedia\lossless actually points to the folder on E:\ then create a script that updates the locations without needing to physically move the files. Once the update is complete the junction could be deleted. Or you could just create the junction and leave things as they are...

tt2

Oops, we talking Mac or PC? Talk of drive letters says PC but the sig says otherwise? Macs can also support junctions aka symbolic links... Ignore me...

Message was edited by: turingtest2

How to edit iTunes database outside of iTunes

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