This is from MacFixIt;
Entire library lost MacFixIt reader Vinko Tsui is one of the few readers who experienced a loss of his entire music library after updating to iTunes 5.0. This problem is unfrequent, though it has occurred with previous iTunes updates, and underscores the importance of backing up your iTunes music library.
Vinko writes:
"I just updated iTunes and after restarting and starting iTunes, all my songs and playlist are gone. It looks like iTunes 5 had created a brand new library for itself.
In other cases, the old Library is simply moved to a different folder, which must be re-added to the iTunes 5.0 library. One reader writes:
"It appears that iTunes 5 have backed up my iTunes 4 Library into a folder called 'Previous iTunes Libraries.' In this folder I found a file 'iTunes Library 2005-9-8.'
"I then navigate to the 'iTunes Music' folder within the ~/Music/iTunes folder. To my surprise, I found many, if not all, my previous music.
"The only way I can find to get my music back into iTunes was to select the "Add to Library..." menu item and choose the "iTunes" folder within my Music folder.
"It appears that I have lost all my previous Playlist and ratings for my songs. This is very disappointing, especially when there did not seem to be a warning about this behavior prior to my upgrade."