First of all, back up the data of your iPhone so that you can conveniently recover them on your new iPhone. As for how to back up the data, it is dependent on your iOS version and your backup method.
iCloud backupiCloud automatically back up your vital data once a day on iPhone (with iOS 5 and above). Alternatively, you can back up them manually.
1. Ensure that your device is connected to Wi-Fi network.
2. Tap "Setting" > "iCloud" > "Storage & Backup".
3. If you need to back up, tap "Backup".
You can see the last time you device was backed up and the new process will take you a few minutes.
iTunes backup1. Connect your iPhone to your computer.
2. Open "iTunes". Click "File" menu and select "Devices" > "Backup". (Note: If you buy something on iPhone but not transfer to your PC, bake up the items by right-clicking "Devices" and select "Transfer purchasing items".)
3. Erase all the content and setting on iPhone.
Make sure that your iPhone is fully charged or connecting to the power source. Tap "Setting" > "General" > "Reset". Finally, tap "Erase all the contents and settings" button. If you have set password before, system would require you to input your password. Then system will confirm again whether to erase all the data. Just click "OK" in the message box.
On the screen, you can see the icon of "Apple" and the process bar. According to different iOS versions and data volume, the process will take you a few minutes or hours. For the jailbreak iPhone, you can also tap "Reset" > "Erase all the content and settings" to delete your data. You'd better delete the Dropbox link to ensure safety.