iTunes Database Modification

Discussion in 'Mac Apps and Mac App Store' started by puhlsar, Sep 21, 2004.

  1. puhlsar macrumors newbie

    Joined:
    Jun 21, 2004
    #1
    Here's the situation—just got a new 160GB external drive and I want to move my 39GB music collection off my PowerBook's internal drive and off to the new Firewire one. Problem is, I want to keep my iTunes Music Folder on the internal drive so the database resides there—that way if I launch iTunes without the drive connected it won't flip out. I also don't want to lose my playlists, play counts, ratings, etc. So I decided to edit the XML file using the UNIX command line tool sed. I used it to change every reference to my former iTunes Music Folder to the new one and spit that out to a new XML file. Then I deleted the old library XML file (after backing it up of course) and imported the edited XML file.

    Here's the rub: I "lost" 4 songs in the process—it imports almost everything, but it claims it can't find some songs and leaves them out. This makes the count go from 9720 pre-editing to 9716. Any ideas on where these references went? Something wrong with my methodology? Or am I making this more complicated than it needs to be?
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    The simplest way to do this is not to edit the XML file, but make the iTunes Music folder inside the iTunes folder into an alias/symbolic link to its true location on the external drive. Creating an alias can be done with the Finder; if you need a symbolic link, you'll need to use the Terminal utility and the "ln -s" command.
     
  3. jackieonasses macrumors 6502a

    jackieonasses

    Joined:
    Mar 3, 2004
    Location:
    the great OKLAHOMA....
    #3
    it is possiable that you "imported" it by dragging it and it is in another part of your hard drive and not the music folder? that happened to me before.
     
  4. buckuxc macrumors regular

    Joined:
    Aug 28, 2003
    #4
    similar problem

    I cannot get iTunes to recognize my external hard drive as my iTunes Library location permanenty unless I keep it permanently connected. This was suggested:

    Ok, so I did both of those things. When I made an alias, that worked fine. I had to "play" every file that had an ! manually (double click it, move on to the next, not play all the way through of course) or else the iPod was never going to update with those songs.

    But, I wanted to see what would happen if I disconnected the external while iTunes was open...and the same thing happened. iTunes immediately created a new iTunes folder in Music, ignoring the alias, reverted the preference to user:Music:iTunes:iTunes Music and made all of my songs not available (! in front of the name) again. When I reconnected my hard drive and changed the location back, it "updated my library" but for some reason there's a couple 100 (out of 5000) songs that still have an ! in front (which means I'm going to have to double click them all again or the iPod will never update.

    I also tried using the terminal and creating a symbolic link. That worked fine, but when I went into iTunes prefs to select the symbolic link as my location, it was grayed out.

    I don't know if the same stuff happens if iTunes is closed before i disconnect the hard drive and opened after it is reconnected; I haven't tried that yet. But, it would be a pain to remember to always close iTunes/then disconnect drive and connect drive/then open iTunes.

    Is there any solution???
     
  5. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    I forgot to mention in my original message to close iTunes before disconnecting the drive, otherwise this little trick won't work correctly. Your post just proved my theory. I suppose you could uncheck the "Copy files to music library" box in iTunes preferences, then delete and re-import all your tunes by dragging them to the iTunes icon...but you'll lose all statistics by doing this, which you may not want. I'm out of other ideas.
     

Share This Page