I’ve found through personal experience that the iTunes library can get corrupted and lose all it’s information – that’s a bummer. I’ve found that what I need to do is backup the library as part of my normal weekly backup.
I’ve found the detailed answer on the apple support site – (click here)
In short, what I do is backup my entire “My Music” folder every week. This includes my iTunes library, so I’m protected.