Battery issue - backup problem?
You should first make a full backup and restore the new iPhone to factory default. Don't worry about your settings, it's stored in the backup so you can place it back if you miss something. Or you could try this fix on the iPhone 5 first.

Problem resolved?
If the problem is gone you shouldn't place the back-up back, as something might be damaged inside. You can now manually download every app and add the Wi-Fi settings.

Unfortunately: You cannot put any part of your back-up back, as it's damaged somehow.

Please
Please don't worry about Wi-Fi settings. You can always ask everyone for their passwords (at least in my circles) they're given out pretty easily. You rather have a fully functional phone and battery rather than all Wi-fi passwords, don't you?

Please note I didn't add an answer to when restoring to clean default does not fix your issue.