Managing your iTunes Library on an External Hard Drive (2007) | iLounge Article

Article

Managing your iTunes Library on an External Hard Drive (2007)

Editor’s Note

A new version of this article is now available.

 

Please see our updated article, Transferring your iTunes Library.

Like many iTunes users, you may have started out with a basic iTunes library storing all of your media content on your primary internal hard drive. However, over time, with the addition of new content and video capabilities, your iTunes library may now be threatening to overtake what little storage you have left.

This is not at all an uncommon situation, and fortunately it’s really not all that difficult to relocate your iTunes library to another hard drive once you understand the basics of how iTunes manages your media content and the options available to you.

This tutorial is intended for both the average and slightly advanced iTunes user and will provide the necessary information that you need to know about moving your iTunes library onto an external hard drive, or even a secondary internal hard drive.

How iTunes Manages Media Content

Before we delve into the steps of actually moving your media content, it’s important to explain in some detail exactly how iTunes handles the management of your media files under the hood, what your options are for relocating these files, and the various pitfalls that you might encounter in this process.

The first and most important consideration is that ideally, iTunes is intended to handle all of the details of the underlying file system for you. By design, the user manages their content through iTunes, and ideally never even looks at the underlying file system, much less worries about moving files around. In this scenario, iTunes can even handle the relocation of the library for you, making the entire process quite seamless.

This may not match every user’s style of media management, but it’s important to understand how this affects the process of moving your media files to a new location.

The most important point to keep in mind is that once a media file is listed in the iTunes library, it is referenced by iTunes by the specific location (ie, full pathname) of where this file is located. Therefore, if you move a file, iTunes will almost certainly lose track of that file, and the result will be a broken link in the iTunes library.

This means that you cannot simply move your files manually to a new location and expect iTunes to find them after you’ve moved them, as it will still look for those files where it originally expected them to be. This one point alone has caused many users a great deal of grief, since repairing this situation can often be a tedious process of either manually adjusting the paths to hundreds of files or manually putting those files back into their original locations so that iTunes can find them again.

Fortunately, if you understand this and use iTunes and its related tools the way they were designed, you can ensure a smooth migration of your iTunes library to an external hard drive or even a completely new computer with minimal problems.

iTunes: The Database versus the Content

Another important point to understand: There are really two components that we are concerned about in this process, and these are somewhat distinct from each other in terms of where and how they are stored.

The iTunes Library Database contains the actual index of your media content. This is generally a file named “iTunes Library.itl” and several other supporting files, and by default lives in your Windows “My Music” folder or your Mac “Music” folder under a sub-folder named “iTunes.”  This path is not modified by any iTunes preferences, and in fact could not be easily changed in versions of iTunes prior to v7.

The iTunes Music Folder contains your actual media content. Despite the name, this includes not only your music, but also audiobooks, TV shows, movies, podcasts and iPod games—essentially all types of content managed by iTunes. By default, this folder is named “iTunes Music” and located as a sub-folder under the iTunes Library Database folder, however this can be changed to any location you prefer via your iTunes advanced preferences.

Generally, when trying to conserve disk space, the iTunes Music Folder is the component that most users wnat to relocate. The iTunes Library Database can frequently remain in its default location for most users, and is generally only moved to an external hard drive when you want to move your iTunes library between more than one computer.

We will therefore focus primarily on the steps required to move the iTunes Music Folder to a new location, and briefly discuss moving the iTunes Library Database later in this article.

Standby to Prepare to Move: Checking your Preferences

So, armed with a basic understanding of how iTunes stores its media content, and knowing that you cannot simply move files around and expect your iTunes library to maintain references to these files, its important to look at how your library is currently setup, and understanding from there what your exact options are.

The key to this process is to review your storage settings under your iTunes advanced preferences, which can be found by selecting Preferences from the Edit (Windows) or iTunes (Mac) menu, and then selecting the Advanced tab:

 

The first option, “iTunes Music folder location” indicates where your iTunes media content is stored by default. Remember that this only includes the media content and not the library database itself. Whether all of your content is located in this folder is going to depend upon the next two settings found on this screen.

Keep iTunes Music folder organized determines whether tracks in your iTunes Music folder are automatically organized based on the track information found within each file. With this option enabled, iTunes will move and rename files within the iTunes Music folder as necessary into an ARTIST\ALBUM folder structure, and name each file based on its track name from within the tags itself. If this option is disabled, then files are left as-is within the iTunes Music folder.

Copy files to iTunes Music folder when adding to library determines whether files that you add to your library are automatically copied into the music folder, or left in their original location. When this option is disabled, however, iTunes will simply store the full path to an added file from wherever its original location is.

Tracks copied into the iTunes Music Folder become “Managed” files (in that iTunes will manage the location and naming of these files), whereas files that are not copied into the iTunes Music folder are “Referenced” files—iTunes stores a full path to the file, but does not actually take any further action with those files in terms of organizing, renaming, moving, or deleting those tracks.

Note that content purchased from the iTunes Store or ripped from CD is always stored in the iTunes Music folder—those files have to go somewhere after all. So, this setting only affects existing files that are added to the iTunes library (ie, MP3/AAC files that you rip via other software or download from other sources).

So why is all of this important?  How you have configured these options is going to determine how much flexibility you have when moving your iTunes media content elsewhere. In a default configuration where all of your media files live within the iTunes Music folder location (“Managed” files), and have been organized by iTunes, the process of moving your library may be considerably smoother than for a user who has a bunch of “referenced” tracks living in various locations and possibly even on different drives.

While iTunes can move your files to a new location in either scenario, the only way to move a library that consists of referenced files is to actually convert them to an entirely managed library approach in the process. Users who have built their own file-system organization for their media content and want to preserve that layout will likely find the process of moving their content to be much more challenging without creating a whole new iTunes library and reimporting it.

Moving Your Content: The Wrong Way

A very common mistake made by most users is to simply try and move their entire iTunes Music folder to a new location and update the iTunes Music folder path in iTunes’ preferences. While this will work in some cases, the reality is that you will risk iTunes losing track of some or all of your music files in the process.

The reason for this is that iTunes stores the entire full path to each music file in its library database. If you move that file somewhere else, then iTunes won’t be able to find it, and the result will be a broken link to that file, shown as an exclamation mark in iTunes immediately to the left of the track listing:

 

If you try to select a track with a broken link, iTunes will notify you that it cannot find the file, and give an opportunity to locate it yourself:

 

Selecting “Yes” will allow you to browse for the file, and iTunes will link the current entry to that specific file. This can be a viable solution for a few broken links, but you can well imagine that this could become very tedious if you had hundreds or even thousands of files in this state.

Should you find yourself in this situation, the simplest solution is generally just to move your iTunes Music folder back to its original location. iTunes still has the complete path to each file in its database, so if you put the actual files back, it should have no problem finding them again.

Note that users who have a completely “Managed” library configuration may be able to get away with using this method to move their library, however it is still not the recommended solution. The reason this method will work in this case is because iTunes will actually look for any missing tracks in their default location under the iTunes Music folder path. So, if your tracks are organized in the way that iTunes expects to see them, then it will be able to locate them in the new location. However, this solution is rarely completely reliable simply because it is not uncommon for users with large libraries to have a few referenced files due to changes to iTunes preference settings or even inconsistent behavior with older versions of iTunes.

Consolidate Library: The Right Way

So, knowing that these pitfalls exist, what’s the best way?  Remember that iTunes’ philosophy of managing your media is actually to insulate you from having to worry about the underlying file system. On the basis of this approach, it makes sense that it should provide the necessary tools itself to facilitate moving your library to a new location.

So in other words, rather than messing around copying/moving files through Finder or Windows Explorer, why not let iTunes deal with this for you?  This is handled in iTunes through the Consolidate Library option, found under the Advanced menu in iTunes.

What the Consolidate Library option actually does it to essentially consolidate all of the files listed in your iTunes library into the iTunes Music folder. It does this by copying any referenced files into the iTunes Music folder, renaming them with the proper track name, and organizing them into its standard file and folder structure (ARTIST\ALBUM, essentially). This option is at least partly intended to allow you to bring “referenced” files into the iTunes Music folder from various other locations in the event that you may have added them to your library with the “Copy Files” option disabled.

However, the only real distinction between a file that is “managed” and a file that is “referenced” is the actual iTunes Music folder path. Files in this folder are considered managed by iTunes, and anything outside is a “referenced” file. So, if you change the location of the iTunes Music folder to a new path and then use the “Consolidate Library” option, iTunes will happily copy all of these files into your new location, updating all of the file location information in the iTunes database in the process.

Performing the Move

So, the actual process of moving your iTunes media content is quite straightforward:

First, go into your iTunes advanced preferences, and change the iTunes Music folder path to whatever new location you want your iTunes media files to be stored in. This will usually be an external hard drive, but it can be any valid path, including a secondary hard drive or even a network share:

 

Once you have updated the iTunes Music folder location, simply select Advanced, Consolidate Library:

 

iTunes will advise you that it is about to copy all of your content into the iTunes Music folder, and warn you that this cannot be undone.

 

Simply click “Continue” and iTunes will begin the process of copying the files into their proper locations and updating these locations in the iTunes library database.

Note that this process copies the tracks to the new location rather than moving them. Although the original tracks still exist, the iTunes library database is updated with the new location, which makes the process difficult to undo unless you have kept a backup of your iTunes library database from before the consolidation. Making such a backup is certainly an option, although not normally required.

The other important note is that this will reorganize your entire library file system into iTunes’ own way of laying it out (ARTIST\ALBUM\TRACK.MP3). This may not be a desirable option for those who have their media file system laid out in their own organizational structure, or who use other third-party applications that expect media files to be organized a certain way. Unfortunately, if you’re in this situation, there really is no easy way to move your iTunes media content without creating a whole new iTunes library and reimporting all of your tracks into the new library from their new locations.

Confirming and Cleaning Up

Once this process has completed, you should be able to confirm that the files have been copied to the new location and that iTunes is referencing them properly from there simply by selecting a track at random and choosing File, Get Info. The “Summary” tab for the file properties will indicate the physical location of that track, which should reflect the new iTunes Music folder path.

Since iTunes copies the media content rather than moving it, you will also likely want to delete the your iTunes media files from their original locations.

Remember that this process only moves the iTunes content however. Your iTunes library database will still be located in its original location, likely on your primary hard drive in your “Music” or “My Music” folder, as described above.

Moving the Library Database

If you’re simply interested in moving your files to a larger disk, there’s seldom any reason to worry about moving the library database, as it doesn’t normally take up a lot of storage space, and there are advantages to leaving this file on your local hard drive and simply storing the content on an external drive.

That having been said, if you do want to move the library database to another location, this is certainly possible as well as long as you’re using iTunes 7 or later. This must be done separately from the process of moving the content described above, and you’re best to run the “Consolidate” operation and move the content first, and then relocate the library database.

To do this, shut down iTunes, and copy your “iTunes” folder (under your “Music”/“My Music” folder) to the new location. Keep in mind that by default, you may still have media content located in an “iTunes Music” sub-folder, and you probably don’t want to waste time copying this content over if you’ve already Consolidated it to another location, so you may want to exclude that one sub-folder.

Once you have copied the “iTunes” folder, including the “iTunes Library.itl” and any related support files and folders, simply restart iTunes while holding down the SHIFT key (Windows) or OPT key (Mac) and it will prompt you to either create a new library or choose a location for an existing library:

 

Simply click “Choose Library” and browse for the location that you copied the iTunes folder to. iTunes should start, and will be using that particular library database instead of the one from the original location. Once you have set this location, iTunes will continue to use it unless you change it again via the same method.

Moving the iTunes library database onto an external hard drive can be useful if you plan to move the external hard drive between multiple computers. It can also be useful to store it in a common area on a local computer for access by multiple user profiles, or even on a network share.

One word of caution, however:  The iTunes database is not designed for multi-user access. If you decide to place it on a network share or in a common directory on a standalone workstation, always make sure that you do not have more than one copy of iTunes running against it at a time, otherwise you will risk corrupting the iTunes database.

Using an External Hard Drive and a Portable Computer

Once you have consolidated your library content onto an external hard drive, iTunes will continue to use that location for any newly imported or downloaded content, subject to your iTunes preference settings.

However, this creates an additional consideration for users of portable computers, since the external hard drive may not always be available. Fortunately, iTunes actually works around this quite well, so there’s no need to pack up the external hard drive when going out with your laptop.

Basically, when you start iTunes with your external drive disconnected, the iTunes Music folder path will temporarily revert to its default location on your local hard drive. This allows iTunes to run properly, although obviously you will not have access to any of the content that’s not already in that location. You will get broken links to any files that you try to access, since the external hard drive is not present. No need to worry, however, as this will correct itself once the drive is available again.

However, this does allow you to download new content (ie, import CDs, add files to your library, download podcast episodes, purchase content from the iTunes Store, etc). This new content will be saved in your local iTunes Music folder, and will be playable from there.

You can even sync your iPod (or iPhone) to your library in this state. “Missing” tracks (those with the exclamation marks beside them) will remain on the iPod, since they are still listed in the library. You obviously won’t be able to add content to your iPod that isn’t already there, but you could certainly sync any new content you’ve added while disconnected, since those files do exist on your laptop computer. Further, even ratings and playcounts will be updated in the iTunes library during an automatic sync.

This can be a useful way to rip a few tracks off a new CD when you’re away from home and get them loaded onto your iPod without having to wait until you get home or having to resort to switching your iPod to manual mode.

Once you do return back home and plug the external hard drive back in, you simply need to restart iTunes and it will detect that its proper iTunes Music folder has returned, and go back to using that as its iTunes Music folder path. Any content you’ve downloaded or imported while you were away from the main library storage area can be transferred over simply by running the “Consolidate Library” option to copy those files over.

The way that iTunes handles this provides a very effective way to maintain a large iTunes library that is somewhat usable on the go without having to keep it all on your laptop’s internal hard drive.

 

 

 

« iPod Overseas Report: Bangkok, Thailand 11/2007

Instant Expert: Secrets & Features of iTunes 7.5 (Updated) »

Related Stories

Comments

1

Hmmm… I move folders and files around alot with my iTunes directory tree and iTunes keeps track of those moves and does not lose track of those files.  This is on a Mac and iTunes is open at the time, but all the files moves are with Finder. 

You see, I usually rip CDs on a different Mac, copy the files to my main iTunes machine, and then “Add to Library” in Itunes and then move them around to the appropriate folders.  I have close to 1.8 Terrabytes of music in iTunes.

Posted by Jesse Hollington in Toronto on November 12, 2007 at 11:44 PM (CST)

1

very nice instructions, and im doing that for quite some time now. on thing though: i am on a laptop, and i have my database files on the external drive, too. (im using xp, and i dont wanna forget backing them up every 3 months when i do a clean install :( )
so when i run itunes without the harddrive connected, it will make a new database in the default directory. and when i import stuff then, the syncing (with an ipod or my main library) wont be that easy, right? am im missing an easy solution here? any tipps on that? thanks…

Posted by Jesse Hollington in Toronto on November 13, 2007 at 4:28 AM (CST)

1

d’oh… you know, a tipp is a hint in german ;) my english sucks…

Posted by Jesse Hollington in Toronto on November 13, 2007 at 4:29 AM (CST)

1

A great tutorial and it worked perfectly for me! But what about your iPhoto library? I sync various albums to my iPod video so I can sort of have a digital photo album with me. I moved my iPhoto library to an external drive, re-synced with iPhoto (which worked great) and then connected my iPod to the laptop. That’s when the problem started - iTunes couldn’t sync my iPod for one reason: it couldn’t locate the iPhoto library. When I moved it back to the original location, no problems at all. Any ideas, iLounge gurus?

Posted by Jesse Hollington in Toronto on November 13, 2007 at 6:09 PM (CST)

1

My content files are on an external HDD already whilst the database resides on my iBook. I wish to transfer the database to a new Mac I’m buying to replace the iBook. I presume I can just copy the database over and in Preferences then change the Folder location reference path on my new Mac? The other question is what if I now also wish to transfer the contents to the new Mac. I presume that the first part of your article then applies? Thanks

Posted by Jesse Hollington in Toronto on November 13, 2007 at 7:21 PM (CST)

1

Curious if moving over the files to the new hard drive (external hard drive) will delete or erase the song ratings or playlists? I have a PC and am worried that I’ll lose all my song ratings and playlists I’ve spent a lot of time building?

Posted by Jesse Hollington in Toronto on November 14, 2007 at 12:06 AM (CST)

1

@betty rocker: thats the thing! playcount, playlists and ratings are stored in the library files. as long as these are ok, you are fine.

Posted by Jesse Hollington in Toronto on November 14, 2007 at 4:36 AM (CST)

1

Hi guys.
I wonder if someone out there can help. I have my itunes library on my laptop and have never moved it before. After reading the article I THINK it’s possible to do what I plan, but just want to double check… basically, I’m going travelling in Jan and would like to move my whole itunes from the laptop and instead keep it on my memory-stick so I can buy new songs and access my itunes library from internet cafes while travelling. Is this an okay way to do it? Also, my boyfriend has his itunes library on a different computer which we are selling before we go… when we get back, we’ll only have the one laptop but two seperate itunes libraries (both stored on our separate memory sticks, I’m hoping)... any suggestions on how we can both access our seperate libraries without buying a second laptop? I figure we can’t run the two seperate libraries from the same laptop, but could he say have his rooted to the harddrive and mine stays on my memory stick, yet accessed via the same laptop???
Thanks in advance for any help.
Becky. :0)

Posted by Jesse Hollington in Toronto on November 14, 2007 at 10:30 AM (CST)

1

so I have movies and music in my iTunes library. . . if I only want the video files on the exterdanl HDD, will iTunes be able to do files from both hdd’s, or does everything have to be in one place. Will an iPod recoginze both? Thanks

Posted by Jesse Hollington in Toronto on November 15, 2007 at 12:43 AM (CST)

1

Great article!  Now I understand the underlying logic of iTunes.  Unfortunately I didn’t understand this when I moved all my music from my laptop to an external hard drive, then ran Consolidate Library.  I then discovered that I had two copies of every song in my iTunes Music folder.  So I spent 2-3 hours deleting all the duplicates, only to find out that most of the songs that are left are not indexed in the libary file.

Question: is there a way to rebuild the library file and therefore reindex all of the music to a new database?  I have several hundred “lost” songs in my iTunes Music folder and it is way too tedious to go back and recreate each link to each song again.

Any ideas?

Thanks!

Posted by Jesse Hollington in Toronto on November 18, 2007 at 7:25 PM (CST)

1

How about moving your itunes library from a pc to a mac?

Can the mac read the pc version of the library file?

Posted by Jesse Hollington in Toronto on November 19, 2007 at 7:25 PM (CST)

1

I transferred about 100 GB of music from a PC to a mac about a year ago.  I self manage my directory structure and wanted to retain the structure.

I found that if the database file is deleted or nonexistent, iTunes seems to read the XML file to recreate the database.  This can take 20-30 minutes.

Since I wanted to maintain my own directory structure, I copied my music director to the mac, figured out the “old” path (on the PC), figured out the new “path” to music folder (on the mac) and used text edit to do a blanket cut and paste in the original “itunes music library.xml” file. 

I then quit iTunes on the Mac moved the XML file onto the default location on the Mac, deleted the “iTunes Library.itl” file and opened iTunes.  After about 20-30 minutes of processing (it provided a status bar to show progress), my Mac iTunes was correctly linked, including playlists, etc.

Posted by Jesse Hollington in Toronto on November 20, 2007 at 2:56 PM (CST)

1

mga3”

What do you mean by “figured out the “old” path (on the PC), figured out the new “path” to music folder (on the mac) and used text edit to do a blanket cut and paste in the original “itunes music library.xml” file. “

Can you expand on that?

Posted by Jesse Hollington in Toronto on November 21, 2007 at 11:00 AM (CST)

1

Yes.  I viewed used TextEdit/Wordpad to view the content of the iTunes Music Library.xml file. 

For example, on Windows, each mp3 has the folllowing tag:

<key>Location</key><string>file://localhost/C:/Documents and Settings/mga3/My Documents/My Music/iTunes/iTunes Music/TLC/Crazysexycool/08 Waterfalls.mp3</string>

In my original move, I had all my music on an external drive, so the string was a little different. 

I then manually moved the entire music folder onto my iMac and put it in the location I wanted it to be permanently located. 

I imported just ONE mp3 into my iMac iTunes and used TextEdit to view the XML file.  While the string was very different, the “iTunes/iTunes Music/...” parts were identical.

I copied the original Windows XML file to the iMac and did a global replace on the portion of the string that needed to change.  After about 25,000 changes, I was able to save and use this XML file as my basis for iMac iTunes.

Does that help?

Posted by Jesse Hollington in Toronto on November 21, 2007 at 1:52 PM (CST)

1

It does help.  Very clear, thanks.

Posted by Jesse Hollington in Toronto on November 21, 2007 at 11:10 PM (CST)

1

Very useful thanks but I have a question. When I’ve added content without my external hard drive connected and then hit consolidate library, itunes attempts to copy all of my music onto the hard drive. I don’t everything copied again…all I want is to update the hard drive with any new music added, in the same way that syncing an ipod does. Any ideas?

Posted by Jesse Hollington in Toronto on November 22, 2007 at 10:10 AM (CST)

1

Sorry, i wasn’t very clear on 2nd read! Basically, I want to sync my external hard drive with anything I add when I’m putting music onto my macbook when its away from the external hard drive. I understand ‘consolidate library’ is the way to do this but when i attempt this it trys to copy all my songs again when i only want to update the external hard drive with the new music. Cheers!

Posted by Jesse Hollington in Toronto on November 22, 2007 at 11:59 AM (CST)

1

Back again.  I just tried my approach from PC to Mac iTunes migration on version 7.5 for a friend and it appeared to ignore the .xml file and overwrite it after deleting the itl file. 

I’ll work on this more and see if it’s version specific or something else that’s going on.

Posted by Jesse Hollington in Toronto on November 22, 2007 at 1:53 PM (CST)

1

Hi, I have at this point have 158 GB of music (ALE) in my itunes library right now, with at least 3 times more than that awaiting. I have only 53 GB left on my iMac HD! Obviously I am needing more capacity, and very importantly ext.hard drive back-up. I was reading J. Hollington’s great article on managing itunes and want to consolidate my library, but obviously if it copies all the songs,I take it at least 158 more GB’s of space is needed to do so?? I was having so much fun importing and enjoying this digital access to feeding nice dac and 2-channel system, that I neglected to really get a handle on my long term needs that I knew was coming. Any thoughts to a macdummie on where I should go from here?? Any help will be greatly appreciated! Thanks, rob755

Posted by Jesse Hollington in Toronto on November 22, 2007 at 3:49 PM (CST)

1

Andrew,
did you find a solution to your duplicate files problem?
Another thing: Since iTines is NOT designed for multi user access, how do we update our libraries so that all files stored on a shared drive are accessible through the libraries?

I really appreciate your help on this.

Posted by Jesse Hollington in Toronto on November 23, 2007 at 6:51 PM (CST)

Sign up for the iLounge Weekly Newsletter

Email:

Recent News

Recent Reviews

Recent Articles

Sign up for the iLounge Weekly Newsletter

Email:

iLounge is an independent resource for all things iPod, iPhone, iPad, and beyond.
iPod, iPhone, iPad, iTunes, Apple TV, Mac, and the Apple logo are trademarks of Apple Inc.
iLounge is © 2001 - 2015 iLounge, Inc. All Rights Reserved. Terms of Use | Privacy Policy