1- If you are a Windows user and don’t want to go through all of this hacking, you can buy iTunes Transfer software at my partner site. It will help you back up your library – with playlists – and transfer it to your other computer.
2- If you’re trying to transfer music from your iPod to your computer, unfortunately, Apple won’t let you do this freely, but you can buy iPod to Computer software for PC (free trial download), or iPod to Computer software for Mac at my partner site that will allow you to do this.
3-if you just have the hard drive of your old PC, Ben has shared with us how to make the transfer
4-if you aren’t keen on messing with XML files – and play count isn’t important to you - Oden has a simple process, involving smart playlists, for retaining song ratings when you transfer your iTunes library.
5- Collin has a simple way to find out those duplicate songs that you may end up with when transferring your catalog.
6-Aaron devised a clever way to transfer while retaining playlists in your collection.
7- If you are transferring between Macs, pbaron has a method involving FireWire mode.
this is the source.