Up until now, carrying over your complete Health database from your old iPhone to a new one required restoring the new iPhone from an iCloud backup or an encrypted backup created in iTunes for Mac and Windows PCs.
Migrating your Health database from one iPhone to another without completely restoring the phone from a previously created backup wasn’t possible without resorting to a multi-step convoluted process involving third-party apps.
The problem is, such apps don’t necessarily support all record types supported in Health.
With the advent of iOS 11, additional stock apps can now securely save and synchronize their data across devices through iCloud, such as Weather, Messages, Health and Siri.
Seamless iCloud syncing for iOS 11’s Health app benefits users by making their fitness and health data available on another phone simply by signing in with their Apple ID in Settings.
This tutorial only applies to users of iOS 11 and later—prior iOS editions lack the ability for Health to sync its database across devices via iCloud.

How to securely store Health data in iCloud

1) Launch the Settings app on your device.
2) Tap your profile image with your Apple ID at the top of the screen.
3) Tap iCloud.
4) Slide the switch for Health to the ON position.
This feature is off by default due to the sensitive nature of private medical information.
Enabling syncing ensures that any health-related data from your Apple Watch and HealthKit-enabled apps collected on this device gets securely stored, end-to-end encrypted, in iCloud.
Now when you sign in to iCloud on your new iPhone with iOS 11 or later, just venture to Settings and flip the switch for Health to the ON position.
Doing so will ensure that your complete Health data stays in perfect sync across devices.
Any changes made to your Health data on one iPhone will now get instantly reflected on all your other iCloud-enabled phones, and vice versa.
And that’s all there is to it.

Now you know how to migrate your Health data to a new iPhone without needing to set it up as new or having to completely restore the device from a previously created backup in iCloud.