Transfer iTunes library (including data such as Playlists and Song Ratings) to a new mac or hard drive:
Before backing up, consolidate the old library (File -> Library -> Organize Library) to avoid missing files.
1. Move your old library (the folder called iTunes) to your new preferred location.
2. Make sure your new empty iTunes is not running.
3. Hold down the key that says "option" or "alt" on your keyboard when starting iTunes.
4. Select "Choose iTunes Library" and locate your old iTunes folder.
5. Select the old iTunes Media folder.