First you have to download the latest version of iTunes onto your new computer, sign in to iTunes and authorize the computer. When you connect your iPhone to the new computer you will see a pop up which states that you are trying to sync to an iTunes library not previously associated with this device. It will give you an option to transfer your purchases to iTunes on the computer, accept the option and everything on your iPhone will be transferred to iTunes on your computer. If you don't select the transfer option, everything on your iPhone will be deleted when you sync.