iTunes database file Nov04 '07

The other day I accidently deleted my iTunes database file. This file contains the data for your entire music library: song names, playlists, ratings, etc. Without it, iTunes reverts to a "fresh copy" of itself, much like if you opened iTunes for the very first time.

The iTunes database file is located in your "home" directory: [username]/Music/iTunes/iTunes Library. Unless you know what you're doing, never move or delete this file!

If you've accidently deleted your iTunes database file as well, you may be shocked when you open iTunes. At first glance, it appears as if all of your music has been deleted.

Fear not, the music files themselves are safe. The iTunes database file only contains information about the music, ie: play counts, album names, ratings, etc.

By default, iTunes creates a new, clean database file if the original is missing. In my case, it turns out I needed a fresh copy anyway, so everything worked out great.

Managing multiple libraries

I've talked on Pain in the Tech about using multiple library locations, specifically a network drive in combination with a local drive. Also, if you've ever changed your iTunes music library, you'll soon realize that the iTunes database file holds information across all of your libraries, which can get confusing if one library is connected, and the other is not.

For example, I used to host my music on an external hard drive, and have since switched to Amazon S3 network storage.

iTunes still references songs that are on the external - songs which I haven't copied to S3 yet. So, iTunes "sees" both libraries, and will attempt to play the song from it's respective library.

To make sure iTunes only references songs on S3, deleting (and letting iTunes re-create) the database file is one way of doing this.

The only question then is, how do you make your "preferred library location" song files show up in iTunes, from a clean iTunes database?

Just go to File > Add to Library, and choose the folder that contains your music files.

Screenshot of iTunes

Screenshot of Mac OS X window

iTunes will then re-create the database file from the music you have chosen. (This may take a while for large libraries.) Bear in mind, iTunes isn't copying any song files - it's simply crawling through your iTunes folder and indexing each artist, album, and song.

Soon after you should see all of your music appear in iTunes.

Note: You won't be able to retain your old ratings, play counts, etc. Unless you've backed up your old iTunes database file, that information is lost.

Categories: iTunes , Tips

Add Feedback (view all)

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

Similar Entries

Stats

1220 unique visits since August 2008

Syndicate

Advertisements