You either do an encrypted backup (including health data) using iTunes/Finder and then restore from backup or Settings>Your Apple ID>iCloud>Apps using iCloud>Messages>On which will resync back when you sign into iCloud on your new iPhone. You can also restore from iCloud backup as long as Messages is enabled to back it up.