Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Move an iTunes library to just about anywhere Apps
Hints have already been published for how to move your iTunes Library to another machine or another drive. The following hint describes a method which should allow you to move your music files to any location accessible via the Finder: another drive, a network share, etc., while maintaining all information such as play counts, playlist membership, cover art, etc. In order to do this, quit iTunes and back up your iTunes library by making a copy of these files:
~/Music/iTunes/iTunes Library
~/Music/iTunes/iTunes Music Library.xml
Move your music files to their new location. Figure out what the new location of your files is in file:// URI notation. The location will be something akin to this:
  • file://localhost/Volumes/DRIVE/PATH for another drive
  • file://localhost/Volumes/SERVER_SHARE/PATH for files on a mounted network share
I do this by dragging and dropping my music folder into an empty window in the Opera browser. Opera will perform the URL encoding for you and display the path in its location bar. This is important if you have special characters in the path, which need to be encoded (spaces become %20, for instance). There probably is a smarter way to do this.

Delete the ~/Music/iTunes/iTunes Library file and move the ~/Music/iTunes/iTunes Music Library.xml file to the Desktop. Then open the iTunes Music Library.xml file using a text editor. Run a search-and-replace in order to substitute the original file locations with the new locations. For example:

file://localhost/Users/username/Music/iTunes/iTunes%20Music/ becomes file://localhost/Volumes/SERVER_SHARE/PATH/

Now launch iTunes; it should show up with an empty library. Choose File » Library » Import Playlist, and select your newly-modified iTunes Music Library.xml file. Wait for iTunes to finish importing (this might take a while, depending on the size of your library).

Enjoy! One note of caution: you may lose your Podcast settings this way; you will need to resubscribe to podcasts afterwards. If you make a mistake, or something fails, you should be able to recover the previous iTunes state using the back up you created before you started.

This hint should be future-proof, because it's based on an official Apple Knowledge Base article.
[19,232 views]  

Move an iTunes library to just about anywhere | 24 comments | Create New Account
Click here to return to the 'Move an iTunes library to just about anywhere' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Move an iTunes library to just about anywhere
Authored by: marook on Fri, Feb 6 2009 at 7:59AM PST
And the Simple solution would be:

1: Quit iTunes.
2: Move your iTunes Library to the new destination.
3: Open iTunes holding down ALT. Now Select your moved iTunes Lib
4: Go to Preferences->Advanced, click Change... and select the Music location here as well.

All done!

I've done this more than ones...

---
/Marook

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: tatilsever on Fri, Feb 6 2009 at 9:19AM PST
Wouldn't your method move the the destination for new music and the library file (which is usually a few MB, as it only holds info, but not the actual media files.) to a new location, but leave the old files where they were? I think a fifth step is necessary:

- File -> Library -> Consolidate Library...

iTunes 6 and 7 used to ask if I wanted to consolidate when I moved the music location, but I don't think iTunes 8 does. You have to tell it to do so.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: marook on Fri, Feb 6 2009 at 12:35PM PST
Ahh, sure. You need to copy the existing music lib. to your wanted location..

---
/Marook

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: postrational on Fri, Feb 6 2009 at 10:03AM PST
This would work, only if all your iTunes music files are inside the iTunes folder and are already managed by iTunes.
If you have files in another location and you sort them yourself, then it wouldn't work.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: tatilsever on Fri, Feb 6 2009 at 2:27PM PST
No. Your files could be scattered all over the place and iTunes can consolidate them properly. I just did it last weekend. Afterwards, you are then free to move your Movies folder etc. to somewhere else again. iTunes is able to keep track of moved files without any trouble.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: Alrescha on Fri, Feb 6 2009 at 11:23AM PST
I think the simpler solution is:

Go to Preferences->Advanced, click Change... and select the Music location.
Go to File -> Library -> Consolidate Library...

Take a nap while iTunes moves your music.

This method does require that you let iTunes manage your music.

A.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: robogobo on Fri, Feb 6 2009 at 9:51AM PST
....waiting to hear more feedback on this one, such as how it affects iPhone sync and such.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: postrational on Fri, Feb 6 2009 at 10:02AM PST
Dunno about iPhone, but iPod sync works perfectly. Takes a while to copy files over wireless from my home server, but copies everything that it should.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: slb on Fri, Feb 6 2009 at 11:58AM PST
Do this.
Copy the iTunes folder (Home/Music/iTunes) to the new location.
Delete (just move to trash) the iTunes folder from your Home/Music folder.

ln -s <new location of iTunes folder> space Home/Music folder <return>

Done.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: postrational on Fri, Feb 6 2009 at 1:39PM PST
Can't create symbolic links across different volumes. Would only work on the same computer, drive and partition.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: slb on Fri, Feb 6 2009 at 1:43PM PST
You better let my iTunes know - it's working as we speak and has been.
Different volume, same computer.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: Bassman59 on Fri, Feb 6 2009 at 4:58PM PST
Dunno 'bout you, but I have my iTunes library on a FireWire disk and I use a symlink to it from the standard location.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: slb on Fri, Feb 6 2009 at 5:11PM PST
Indeed.
I know the server model is out, but who wants it on a server?
not me :)

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: postrational on Fri, Feb 6 2009 at 1:41PM PST
Can't create symbolic links across different volumes. Would only work on the same computer, drive and partition.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: Alrescha on Fri, Feb 6 2009 at 5:36PM PST
Ummnn.. the whole *point* of symbolic links is to work across volumes. On the same volume, you'd just do a normal link.

A.

[ Reply to This | # ]
normal link?
Authored by: sjk on Mon, Feb 16 2009 at 1:58PM PST
What do you consider a "normal" link? Both hard and symbolic links are normal to me, just often used for different purposes.


[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: kikjou on Fri, Feb 6 2009 at 7:54PM PST
Who wants to have the iTunes library on a server? Anybody who has a large music collection (and that does for movies as well). And now my entire household can listen to my music.

[ Reply to This | # ]
Symlink to a Server Volume
Authored by: asteryx on Sat, Feb 7 2009 at 9:40AM PST
I've used a symlink to a server hosted "iTunes Music" folder since iTunes version 4. It's a great way to share the same music files among our family.

The key is to make sure that your file server permissions allow the group to read & write to the music files. This allows the members of the group to update artwork, etc.

Note that when you use this method, each person's (account) has a different iTunes Library. Since the library is really only a sort of index on steroids to the Music folder linked above, one can customize playlists, ratings, etc. in their own library without affecting someone else's library. All of this requires iTunes to manage the music.

One minor issue... when someone adds music to the library (by purchase from the iTunes Store or ripping a CD, for example) the other iTunes libraries don't automatically update. The owner of the library must use File, Add to Library and locate the new music files to index.

All of the above syncs to two different iPhones (a 1st generation EDGE only, and an iPhone 3G) and wirelessly to an AppleTV. The AppleTV only syncs with one user account, not with all of the accounts.

As an aside, our family also uses a similar technique to share a single iPhoto library as well.

[ Reply to This | # ]

Symlink to a Server Volume
Authored by: jamietshaw on Sun, Feb 8 2009 at 3:44AM PST
Keeping computers synchronised from a central server is a bit of an issue. We have music on a NAS but with iTunes library files on each Mac so we keep our own ratings etc.

The Syncopation program mentioned earlier looks like it could help once you've ticked 'Import tracks without copying', and possibly turned off the attribute synchronising options, both in Preferences.

I wrote my own program a few years ago which you may have if you like, but it was and still is my first AppleScript/Xcode application so it's not particularly well written! It has to be run manually, copies your tracks into a text file, does a Unix find command to make another text file that lists tracks on the sever modified after a specified date, then does some more Unix stuff to compare the files and import the ones not in your iTunes into a playlist. If anyone does want my far-from-perfect program email me - jamietshaw at the 'googlemail' address.

Another thought was to use Folder Actions but they seem very unreliable.

[ Reply to This | # ]
Symlink to a Server Volume
Authored by: asteryx on Sun, Feb 8 2009 at 11:29AM PST
I agree that keeping the individual libraries synchronized is a problem. But I leave that up to the individual anyways. I don't care if my son marks a song or a movie with 1 or 5 stars.

My concern is that the .mp3, .aac, .m4b, etc. files are all in a single location. (These are then backed-up using both Time Machine and Mozy.)

The rest, for us, is just communication. I have to let my wife and kids know when I've imported new music or movies into the file location so they can update their individual libraries if they choose. Or I can remote into their systems and update their libraries if they ask.

[ Reply to This | # ]

Move an iTunes library to just about anywhere
Authored by: dwebb66 on Sat, Feb 7 2009 at 1:43PM PST
Can someone please verify that music selection in the other iLife programs still work? I tried this about a year ago and the other programs could not find the music. For example adding music to a photo slideshow.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: irc on Mon, Feb 9 2009 at 12:37PM PST
I can confirm that this works. I have no problem finding my music in iMovie after having done a similar over-the-top move of my iTunes library. I wrote up my trials and tribulations moving my library here:

http://iaresee.blogspot.com/2009/02/moving-your-itunes-8-library-to.html

There's some Perl to verify that you've moved all the files and didn't miss anything. That script could easily be modified to do the .xml file conversion to the new file:// path. I did just do a find-and-replace in vim though...

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: asmeurer on Tue, Feb 17 2009 at 8:20AM PST
I got a new hard drive and copied my old iTunes data over from the old one, but it wasn't recognized. I tried copying and replacing the data, but iTunes would just revert it. I ended up temporarily renaming my new hard drive the same as the old one so that the paths of the files would be the same, then "touching" all the files in iTunes. This can be achieved by playing each file or, as I did, opening get info on the first item in the Library and holding down Command-N until the last file is reached (this takes some time, you might want to use sticky keys and a weight on your 'n' key like I did). Once the files have been touched in this way, rename the drive (or any part of the path, really) while iTunes is still open, so that it recognizes it.
This is a simple solution if you can temporarily make your new path identical in name to the old one.

[ Reply to This | # ]
Move an iTunes library to just about anywhere
Authored by: asmeurer on Tue, Feb 17 2009 at 9:19PM PST
On second though, maybe this didn't work so well. At any rate, I think the commenters below are correct, there is no need to do a search replace in the xml file. Just move the library in the preferences and do a consolidate.

[ Reply to This | # ]