I recently got the new iPhone 4 but it doesn't have my contacts and old text messages etc. I previously had the iPhone 3gs. When I upgraded my iphone 3gs to iphone 4 they gave me a new sim card but it was basically a replica of my old sim card (eg.same number).
You can do with your itunes for it you have to put them on your itunes.iTunes will backup everything on the iPhone. In iTunes, with the iPhone selected on the left, click the Info tab and make sure Contact syncing is enabled. Besides,there is a article about How to transfer contacts from iPhone to iTunes, which can help you transfer data from iPhone. Good Luck.