Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Moving an iTunes remote library to a local drive Apps
Problem:
You have over 15,000 MP3s that exist on a remote server, and you want to relocate them to your local machine while keeping your iTunes Library information (mostly) intact.

Solution:
After moving the files to your local machine, iTunes will stubbornly look for them on the remote host. If said host no longer has those files, iTunes will ask to locate each individual file (which is bad). Export your iTunes Library from the File -> Export menu. I recommend doing this twice, just in case. Close iTunes, then remove your /Users -> username -> Music -> iTunes 3 Music Library and iTunes Music Library.xml files. I recommend backing them up, possibly by adding them to a .sit and trashing the originals. Bring up the Terminal, and open the exported Library.xml file in vi (or your editor of choice).

In the Library.xml file, look for a section named "<string>file://localhost/path/to/mp3.mp3</string>. If your files are located on a remote host, the pathname may look like "file://localhost/Volumes/mp3/....". Perform a "find and replace" in your text editor, changing each instance of "Volumes/mp3" to the new path, "Volumes/newdrive". In vi, the command would be:
:%s/Volumes\mp3/Volumes\/newdrive/g
This line breaks down as follows:
  • : - The command prompt
  • % - The whole file
  • s - Search and replace
  • /Volumes\/mp3/ - Search for this
  • /Volumes\/newdrive/ - Replace with this
  • g - Replace every instance on each line
Note that you have to escape [\] the forward slashes in vi.

After saving your changes, when you open iTunes you will see that it has been restored to its initial state. From the File menu, select "Import", and choose your "fixed" Library.xml file. Go watch a movie for the next hour. This is a two-step process: iTunes will import the files based on the Library.xml information, and it will re-analyze each file "to determine song volume". If some songs can't be found, iTunes will warn you first, then continue on to do the volume analysis.

When this process finally completes, you will be left with a (hopefully) functional iTunes library, complete with star ratings. You should note that "play count" and "play-date" type information will not survive the import.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[10,728 views]  

Moving an iTunes remote library to a local drive | 7 comments | Create New Account
Click here to return to the 'Moving an iTunes remote library to a local drive' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Consolidate?
Authored by: iggybird on Jan 27, '03 11:38:53AM

Can't you just consolidate your library?



[ Reply to This | # ]
Re:Consolidate [Why copying is bad]
Authored by: unxmaal on Jan 27, '03 04:49:25PM

A sane person could consolidate, yes. However, an insane person, who has over 15,000 mp3s [entire CD collection backed up to HD] that existed on a remote server, cannot feasibly "consolidate".

The main reason is that iTune's 'consolidate' simply copies files from the remote server to the local machine, across the network. This is bad, because there is a chance for the data to become corrupted during the transfer, especially during a large, long transfer across a live network.

The only reliable way to copy data across the network [in any situation] is by using an program that will verify the data integrity [by use of checksum or crc or whatever]. In my case, I used rsync, but you could use tar or cpio or maybe ditto.

Now that the files exist on my local machine, I could "consolidate". However, consolidate assumes that the ID3 tags are correct, and relocates the files to a directory structure based on the ID3 tag information. As I do enjoy doing other things besides fixing my ID3 tags, I have about 2000 mp3s that do not even have tags, which would result in 2000 songs being dumped into an 'unknown artist' folder.



[ Reply to This | # ]
Create a folder in /Volumes?
Authored by: david-bo on Jan 30, '03 05:09:25PM

Just a thought, sometimes, by mistake, Applescripts I use has created folders in the /Volumes-directory - can't you do something similar in this case, at least as a temporarily workaround?

I.e., create a folder with the same name as the server in /Volumes. If you mount the server now it will have a '-1' appended to its name.



[ Reply to This | # ]
Moving an iTunes remote library to a local drive
Authored by: kmriley on Jan 09, '04 05:43:58PM

I had to do something similar to this because I moved my mp3s from one machine to another. Suddenly, iTunes could find no music and I had to manually find each file because it thought all the music was sitting on the previous machine over the network.

I have tried what you did - manually changing the xml file, which is infinitely easier. But, when I try to import that new xml file, it still cannot find the files. The new xml file show that all the missing files still sit on the remote drive.

Anyone still active on this problem and have a fix?



[ Reply to This | # ]
Moving an iTunes remote library to a local drive
Authored by: Alexai on Jan 09, '04 10:24:13PM

sounds all quite complicated. Why can´t i just call up itunes preferences, go to the advanced tab, change the itunes music folder to where you want to swap your entire collection, then deselect "copy files to itunes music folder when adding to library. Then you swap your files to the new location - and that is where itunes will look for the music. You´re done i think. That´t what i intend to do.
But after reading your posts, i hesitate. Please could you detail why i should not go ahead with the procedure layed out here. What am i missing?



[ Reply to This | # ]
Another option: Using a Symlink
Authored by: nickv2002 on Jun 16, '07 02:39:39PM

I had a similar experience where I told iTunes to move my library but it got interrupted halfway through. I attempted to use this hint to point iTunes to all the right files but it didn't work (they still had exclamation points indicating they were missing). What I ended up doing was replacing the 'wrong' folder with a symlink (Unix alias) pointing at the right location. Relaunching iTunes after doing that worked like a charm with no missing files.

Luckily though my music library is large (10000 songs or so) I keep it well organized so I could subsequently move the library location within iTunes and the consolidate it to keep it organized. Once those two things were done I deleted the symlink and everything still worked great.



[ Reply to This | # ]
Another option: Using a Symlink
Authored by: nickv2002 on Jun 16, '07 02:42:07PM

I forgot to mention another perk of this method. Since the moving is done within iTunes, it preserves play-count/last played/etc values that the hint's method looses. Since I use many of these for smart playlist it was essential that I keep this info intact.



[ Reply to This | # ]