Screenshot:

Preparation: Free download iPhone 3G to iPhone 4 Transfer and install it to your computer/Mac. Double click the icon to launch it.
Step1. Connect iPhone 3G to computer, the iPhone 3G to iPhone 4 will detect your iPhone automatically, and then the playlist on your iPhone 3G will be shown on the left as the above picture shows.
Step2. Open the playlist, find files which you want to transfer from iPhone 3G to iPhone 4, then check in front of files. Even you can select multiple files at one time.
Step3. Click
button, and browse your computer to set an output folder, the program will start to transfer iPhone 3G to pc.
Sync files to iPhone 4
Open iTunes. Click "iPhone 4" icon to open your iPhone 4 library. Select file type and check item you want to sync, when it is done, press "Apply" button to start iPhone music/video files to iPhone 4 library sync process.