Building a summer residence for your iTunes Library

by  |  09/12/2008

When things get cramped up in your internal hard drive, you better start considering saving some storage space. The iTunes Library is a somewhat complex device, meant to keep track of all your media content you have registered through it onto your iPod. If your iPod's capacity reaches beyond 20GB like most common iPods are today, then 20GB are duplicated in your primary internal hard drive by iTunes, taking up storage space, slowing down computer processing abilities and so on.

So it's not that difficult to get through the steps required to move your entire iTunes library onto an external hard drive once you've picked up the basics on how iTunes works with your media content and what you can do to about it.

For starters
Starting with some basic information on how iTunes works, you should know that it's primary purpose is to handle for the user everything that the underlying file system implies, so the user simply manages his content through iTunes with no actual contact with the underlying file system itself. In some conditions, iTunes will handle the complete relocation of the library for the user.

The basic principle upon which iTunes works is that once a media file is listed in the iTunes library, it is referenced by iTunes by the specific location, the full pathname, of where the file is located. Consequently, when the user moves a file, iTunes loses track of that file, because of a broken link in the iTunes library. It is obvious that one cannot start moving a bunch of files around and expect iTunes to keep track of them, since iTunes only has the pathname of where the file originally was. Those pathnames don't update by themselves. If you plunged ahead without knowing this, the only thing left to repair all those broken links is to manually adjust them in iTunes, or manually replace them in their original positions so iTunes find them again.
During the following process you have to keep in mind two basic components that iTunes uses when managing media content.

    *  The iTunes Library Database is generally a file named “iTunes Library.itl” and contains the actual index of your media content. You can locate it bu default in the Windows “My Music” folder, and on a Mac OS X in the “Music” folder that is under the sub-folder “iTunes”. The place where this file rests is not subject to modifications through an iTunes preference.

    *  The iTunes Music Folder is the file that actually contains the media content. Don't be confused by the name, it also contains audiobooks, TV shows, movies, games and podcasts, everything you put on your iPod. The folder is named “iTunes Music” and you can find it as a sub-folder under the iTunes Library Database folder, but, unlike the “iTunes Library.itl”, it is subject to change by an iTunes preference option.
Because the iTunes Music Folder is the one occupying storage space, due to the fact that it holds all the media content, this is the one that most users want to move out of their internal hard drive. The iTunes Library Database is moved in general when you want to move your iTunes Library between more than one computer.


Preference management

First of all, you need to review your storage settings under your iTunes advanced preferences, which can be found by selecting Preferences from the Edit tab in Windows or iTunes menu from Mac, and then choosing the Advanced tab.

“iTunes Music folder location” which would be the first option, indicates where your iTunes media content is stored. This location indicates only the media content itself and not the library database itself. It is important to know if your entire media content is stored in this same place or scattered around, even on different internal hard drive partitions.

The next setting, Keep iTunes Music folder organized determines whether tracks from your iTunes Music folder are automatically organized based on the track information within each file. If this option is 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. With the option disabled the files are left as they are within the iTunes Music folder.

The third setting, Copy files to iTunes Music folder when adding to library determines whether files that are added to the library are automatically copied into the music folder as well, or left into their original location. If the option is disabled, iTunes will simple store the full path of the added file of its original location.

There's a difference between stored files in iTunes Music folder and those not copied there: the first are “Managed” files, iTunes managing their location and naming, and the second are “Referenced” ones, iTunes just storing the full paths to the files, not taking any further action like organizing, renaming, moving or deleting them.

Note to user:  Media content purchased via iTunes Store or ripped from CDs always ends up stored in the iTunes Music folder. So the last setting affects only files that are added to the iTunes library, ripped through other non-Apple softwares or downloaded from other sources.

This notions are important to know, because once you have configured the settings above by making the entire media content to lye within the iTunes Music folder, that is, to be “Managed” files, the process of moving the library to an external hard drive is much more simpler than to move “referenced” tracks hosted on various locations.

Sure you can choose the hard way and move to a new location the whole lot of referenced files through iTunes, which is not impossible but considerably harder than to just create an entirely managed iTunes library and import it.


What not to do

What most users rush to do and is of course wrong most of the times, is to move their entire iTunes Music folder to a new location and just update the iTunes Music folder path from iTunes preferences. Although some times this might work, the fact is that most of the times iTunes loses track of some or maybe all of the music files along the process. This happens because iTunes stores the entire full path to each track in its library database. If the file is moved, iTunes won't be able to find, resulting in a broken link to that file, displayed as an exclamation mark in iTunes track listing.

If you select a track with a missing link, iTunes will pop a message that it cannot find the file, and give the user the opportunity to locate it manually. Choose “Yes” and locate the file, and iTunes will link the current entry to the specified file. While this is a valid solution for a handful of broken links, it's absurd when confronted with hundreds and even thousands of files like this. The simplest solution for the latter situation would be to just move the iTunes Music folder back where it was, since iTunes still has the complete path to each file in its database.


What to do

If iTunes purpose is to manage media content by keeping away from the user anything that would imply direct contact with the subsequent file system, it is only normal that it would be gifted with the proper tools to facilitate itself moving the entire library to another location. This been said, it would be a good idea to let iTunes do the job for you, instead of making a mess moving around files in Windows Explorer or Finder.

You can let iTunes do the job for you, by enabling the Consolidate Library option that you can find under the Advanced menu in iTunes. Through this option iTunes consolidates all the files listed in the iTunes library into the iTunes Music folder, by copying any referenced files into the iTunes Music folder, renaming them with the proper track name and organizing them in its default file and folder structure, which is Artist\Album. By doing so, you are enabled 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.

You should know that the only actual difference between a file that is managed and a file that is referenced is the particular iTunes Music folder path. Files coming from this folder are regarded as being "managed", and anything coming outside of this folder is considered "referenced". In the event of changing the location of the iTunes Music folder to a new path by using the "Consolidate Library" option, iTunes will copy all of the files into a new location, by updating all of the file location information in the iTunes database in the process.


Moving the iTunes Library

Here are the actual steps of moving the iTunes Library to a new location:

   1. Follow iTunes advanced preferences where you have to change the iTunes Music folder path to wherever you want the iTunes media files to be stored in. You can usually choose an external hard drive, but you can type in any valid path, like a secondary hard drive or even a network share.

itunes 2


   2. After updating the iTunes Music folder location, select Advanced>Consolidate Library. A message will appear saying that iTunes is about to copy all of the content into the iTunes Music folder and that the process is irreversible. Just click "Continue" and let iTunes start the process of copying the files into their proper locations and updating these locations in the iTunes library database.

itunes 3

Note to user 1:  This process just copies the tracks to the new location, it doesn't move them. Although the original tracks still exist, the iTunes library database is updated with the new location, which makes the process difficult to reverse unless there is a backup of the iTunes library database from before the consolidation. Making a backup is an option, but not a prerequisite.

Note to user 2:  This process will reorganize the entire library file system by iTunes own layout model, which would be Album\Artist\Track.mp3. This may not be the ideal organizing form for those who have their own arrangement structure, or for those who use third party applications that work with media files organized in certain ways. For this situation, the only thing to do is create a whole new iTunes library and reimport all the tracks into the new library from their new locations.

   3. After the process is completed, you may confirm that the files have been copied to the new location and that iTunes is referencing them properly from there by simply selecting an ordinary track and choosing File>Get Info. In the "Summary" tab for the file properties you will find the physical location of the track, reflected by the new iTunes Music folder path.

   4.  Because iTunes copies the media content instead of moving it entirely, it is desirable to delete the iTunes media files from their original locations to save up storage space on your drive.

Note to user: This process will only move the iTunes content. The iTunes library database that we have spoken about before, is still located in its original location, usually on the primary hard drive in the "Music" or "My Music" folder as stated earlier in this article.

 
Moving the iTunes Library Database

Moving the iTunes Library Database file is possible only with version 7 of iTunes or later and must be done separately from the process of moving the actual media content, by first running the "Consolidate" operation and move the content and then relocating also the library database. Normally, only the media content is subject to moving to a larger hard disk because the library database would work fine on the hard drive as well, and easier for that matter, and it doesn't take up much storage space.

But if you're still keen on moving the library database as well, then start by shutting down iTunes, and copying the "iTunes" folder, found under either "Music" or "My Music" folder, to a new location.

Note to user:  By default, there might still be some media content located in an "iTunes Music: sub-folder, and it would be useless to copy this content over also if you've already used the "Consolidate" option, so you may exclude this one sub-folder.

After copying the "iTunes" folder, including the "iTunes Library.itl" and any other related support files and folders, just restart iTunes while holding down the SHIFT key, for Windows users, or OPT key for Mac users. This will prompt the user the either create a new library or choose a location for an existing library. Click "Choose Library" and browse for the same location where you copied the iTunes folder. When iTunes starts, it will be using the library database from that location and not the one from the old location, until it is changed again by the same method.

Note to user:  To move the iTunes library database on an external hard drive is useful if the same drive is used with multiple computers. It also useful to have it stored in a common area on a local computer for multiple access by users, but keep in mind the danger of corrupting the iTunes database if multiple iTunes instances are running at the same time.

Tips and tricks with laptops and external drives

After the library content is consolidated on an external hard drive, iTunes will use that location for any new imported or downloaded content, according to the user's iTunes preferences. Users of portable computers should take into consideration the fact that the external hard drive may not always be available. However, iTunes is designed to manage this situation as well, so there is little effort to do from the user.

The idea is that when you start iTunes with the external hard drive absent, the iTunes Music folder path is temporarily reverting to its default location on the local hard drive, allowing iTunes to run normally, although the user has restricted access to any of the content that is not already in that original location. The user will get broken links messages to any file he tries to access, because the external drive is disconnected, but this fixes by itself once the drive is connected again.

You can download new content, like import CDs, add files to the library, download or purchase content from the iTunes Store etc, while the new content will be saved in the local iTunes Music folder. You can also sync an iPod or iPhone to the library, while "missing" tracks will remain on the iPod, since they are still listed in the library (with exclamation marks next to them). What a user can't do, is to add content to the iPod that is not already there, but the user can sync any new content added while the external drive was disconnected, since those files actually exist on the laptop. Ratings and playcounts will also be updated in the iTunes library during an automatic sync.

This situation has some advantages, in the sense that one may rip a few tracks off a new CD and get them loaded on an iPod without needing to wait until arriving home or having to resort to switching the iPod to manual mode. Once the user plugs in the external hard drive back again, just restart iTunes and the software will detect that its proper iTunes Music folder has returned, going back to using that as its iTunes Music folder path. The content that has been downloaded or imported while the main library storage was disconnected is transferable by running the "Consolidate Library" option to copy those files over.

iTunes was generally built to provide a satisfactory experience even when the user maintains a large iTunes library somewhat independent from a fixed hard drive.

Copyright © 2010 www.softmetro.com - All rights reserved.