Congratulations on the new iMac! There are a few ways to get your music over, and I have an article that outlines the different methods. You can find the article here:
The Home Sharing method is what I find to be the easiest if both computers are connected to the same network. You will have to export the playlists separately, and those steps are also included in the Home Sharing section.
Have fun with the new iMac! I know I love mine!