Apple provides some valuable info for iPhone upgraders:

Summary

This article explains how to replace an original iPhone with an iPhone 3G using the same carrier. If you follow these steps to backup your original iPhone first, and then restore the backup to your iPhone 3G, your saved SMS messages, email accounts, photos, notes, and other personal settings will be present on your iPhone 3G.