How to sync iPhone to new Mac (iTunes)?

I have an iPhone 4, and I just got a Macbook, I'm trying to figure out how to copy the music from my iphone to my itunes without deleting it! Some of the music i have is from CD's or Downloads so all of it is not purchased, Can someone help me out, google/Youtube have helped me none.

You need a third party application like iRip because Apple is paranoid about piracy lawsuits/ iTunes revenue.