Saturday, April 14, 2012

how NOT to update the paths to files in your iTunes library

learn from my mistakes...

I have many kids movies and tv shows in my iTunes library for playing on the apple tv and the iPads for the kids to watch on car trips and such. Years ago I moved it to a portable external drive. I recently outgrew that drive and purchased a new, shiny 1.5TB firewire 2 drive. I copied all the original ones over and then was faced with the problem of how to get iTunes to realize that all the moves had moved. I only ever stored movies on the external drive, all my music and other things I keep internal to the macbook.

You can do this easily enough by just turning on and off the checkbox in the preferences for when to copy items into the itunes folder. Turn it off when dragging in a movie and back on for everything else. For purchased movies you have to move them in the finder and then delete and re-add them from iTunes, which is more steps but I dont purchase movies that often so it’s hardly a handicap.

But then you can’t just copy they whole iTunes library from one device to another, you need to be able to move parts of it around and there doesn’t seem to be a way to batch change the paths.

When I undertook the exercise I thought that I would just delete them all from the database and then drag them back in from the external drive and re-organize them. This is what I SHOULD have done. Instead I went searching around the internet and found other people in similar situations that had edited the iTunes.xml file that stores the information. I opened this up in BBEdit and was able to see all the old paths and easily do a replace to put in the path to the new drive.

However, iTunes doesn’t normally read that XML file, it normally uses a binary database file in the same folder that ends with “.its” and so you have to delete that to force it to rebuild it with the new path information. I did this and restarted iTunes (after making backups of course, which come to think of it I should have just immediately put back)

iTunes chewed on that for quite some time and then it all came up and the movies played from the new drive fine. I didn’t immediately notice all the other things that had gotten broken.

iTunes no longer knew about any of my iOS apps, it wanted to downloaded purchased items from my phone and proceded to do so for ALL the apps I had ever purchased. It has also lost all my podcast subscriptions which I will be rebuilding next.

So when searching for info on how to move portions of your iTunes folder, think twice before deleting the its file and making it rebuild it from the XML as it appears that not all the information is actually stored in the xml file.

Not a disaster as things go, nothing was actually lost, just making more work for myself by trying to reduce the work for myself ;) Which is pretty par for the course on a normal day!

MORE INFO as of 4/16: Got tired of trying to get everything back and restored backups of my iTunes library. Spent quite a bit of time investigating applescript methods of updating some of the location paths before I discovered that iTunes actually has built in ability to fix this itself. After locating one of the moved files it asks you if you’d like to use that new location to try to find others. Never noticed that before ;) And it did find all the other moved files on the new disk. So we’re all back to normal now and while I’ll never get those hours wasted back I have a much deeper understanding of iTunes applescript dictionary now which I’m sure will come in handy someday.

No comments:

Post a Comment