Just sync your 3G one last time so you have a recent backup. Connect your 3GS and follow the prompts. When it asks you if you want to set it up a new phone or restore from backup (can't remember the exact wording), select the restore from backup option and select the backup you just made.