It can be tricky. You'll want to transfer your iTunes over to the new computer first, unfortunately not an intuitive or well-documented process. Do some Googling on it and I'm sure you'll find several step-by-step guides.
I was thinking of switching my iTunes sync from my Mac over to the PC in my office. Looked like such a hassle, I moved the Mac into the office instead

----------
That will work if all your media is purchased through iTunes, but it won't move media you ripped from your own CD's or obtained elsewhere.