So you're a proud owner of a new iPhone 4 - maybe you were even in the same line I just stood in to get mine this morning.
But now you realize you have a considerable investment in apps and music sitting on your old iPhone 3G or 3GS, and don't know how to transfer them over to your new iPhone.
The trick is to first backup your old phone to iTunes, and then you can restore this backup to your new iPhone, which will transfer everything over.
Here's how to transfer purchased apps and songs from your iPhone 3G/3GS to your new iPhone 4 in 5 easy steps:
1. Connect your old iPhone to your computer and open iTunes.
2. Transfer your purchases by right-clicking your iPhone in iTunes and selecting "Transfer Purchases" from the shortcut menu.
You'll see iTunes transferring your apps and songs from your old iPhone to your computer:
3. Backup your old iPhone.
Right-click on your iPhone again in iTunes and select "Back Up" from the shortcut menu.
4. Connect your new iPhone 4 (after disconnecting the old one of course).
5. Restore your iPhone 4 using the old iPhone's backup.
Right-click again on your iPhone 4 in iTunes and select "Restore from Backup".
Choose the backup you created in the 3rd step above:
Click "Restore" and wait for iTunes to restore from the backup (which also transfers over your purchased apps and music):