We will create a full tutorial on this subject once the 3G iPhone is released. For now you can read the instructions Apple has provided below...
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.
To replace an original iPhone with an iPhone 3G, follow these steps:
1. Purchase iPhone 3G from an Apple Store or from a carrier. For more info, choose your country then click on where to buy.
In the US, iPhone 3G includes a SIM and your original iPhone's SIM is not needed. Your original iPhone account information will be transferred to iPhone 3G's included SIM when you purchase iPhone 3G. To dispose of your original iPhone SIM, contact your carrier.
In other countries where the original iPhone was sold1, you can use your original iPhone's SIM with iPhone 3G. Contact your carrier for additional information.
2. Make sure you have the latest version of iTunes and iPhone OS. Click to download the latest version of iTunes.
Note that when you start using iPhone 3G, you will need iTunes 7.7 or later.
3. Connect your original iPhone to iTunes and sync it. Verify that your original iPhone is backed up. For more information on how to do this, see iPhone: About backups.
4. Connect iPhone 3G to iTunes (on the same computer you used to back up your original iPhone), and then iTunes will ask you if you want to restore from a backup or set up iPhone 3G as a new phone. When prompted, select the backup of your original iPhone2.
5. After iTunes finishes restoring the backup you selected to iPhone 3G, iPhone 3G will restart. When iPhone 3G appears again in the iTunes window, select it. Then click the tabs (Music, Photos, and so on) and verify or change the items you want to sync. Then click Apply to sync iPhone 3G with iTunes.
6. Verify that your saved SMS messages, email accounts and passwords, photos, notes, and other personal settings are present on your iPhone 3G.
If saved SMS messages, email accounts and passwords, photos, notes, or other personal settings are not present on your new iPhone 3G, the restore from backup may not have been successful. In that case, verify your original iPhone is properly backed up (see step 3), then use iTunes to restore iPhone OS on iPhone 3G and continue following these instructions at step 4.
To erase your original iPhone so someone else can use it, tap Setting > General > Reset > Erase all contents and settings on your original iPhone.