Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

puhlsar

macrumors newbie
Original poster
Jun 21, 2004
9
0
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?
 
puhlsar said:
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?
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.
 
puhlsar said:
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?
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.
 
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:

wrldwzrd89 said:
I think you've done it wrong. What you need to do is alias the entire iTunes folder to your external HD so that your music and iTunes library stay together. Basically, you need to go up one level for the directory you're creating an alias of. Copy the iTunes folder (assuming it's already been gutted of music) over to your external HD (won't take very long - iTunes music libraries are nowhere near as large as the combined size of all the music files), delete the alias to iTunes Music inside the copy, move the iTunes Music folder you copied earlier inside the iTunes folder you just copied, then delete the original iTunes folder, and finally make an alias of the iTunes folder on your external HD and put it where the old iTunes folder was. This way, you don't have to tell iTunes where your music is, assuming you've used the default location - iTunes will find it by navigating the alias. If that doesn't work for some reason, you'll need to make a symbolic link instead in the Terminal. The command you'll need is:
Code:
ln -s ~/Music/iTunes (drag iTunes directory from external HD into Terminal window)
Where it says (drag iTunes directory from external HD into Terminal window), do that. Make sure there's a space between the the beginning of the command and the directory you just dragged, otherwise it won't work. Once the command is completed, press Return to execute it. You can now close Terminal, unless you need it for something else.

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???
 
buckuxc said:
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???
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.