The mother board or logic board of your iPhone contains all your data.
You can replace the logic board or have someone with some micro soldering skills re-solder or replace the antenna socket. It is a pretty straightforward repair.
You can also just purchase a refurbished/used iPhone 4 or 4S. They should be pretty cheap by now, and cost almost as much as the logic board itself.
If you insist on replacing the logic board, all you have to do is connect your iPhone to iTunes on your computer and click on "back up now" then choose "back up apps" when/if prompted and also "authorize this computer" when/if prompted. Once done, repeat the process one more time. Alternatively back up everything on iCloud directly from your iPhone via Wi-Fi or Cellular.
Once you install your new logic board, connect your iPhone back to the computer and click on "restore back-up" (not restore iPhone). Alternatively, enter your iCloud account info directly on your iPhone and restore from iCloud directly back to your iPhone.
A note of caution: used phone or logic boards may be defective, have hidden defects such as water damage or other intermittent faults that appear some time after you start using it.
Also be careful to purchase an unlocked board or phone, by using the new boards' imei number on icloud.com to check the activation lock status.