This is a real issue at design level. This should have been part of the specifications, I don't understand how they can ship unfinished piece of software in latest Android version.
So when changing phones we got to transfer some data. For that we can use backup and restore tools. Those backup messages, settings, etc. so we can restore the backup on the new phone.
Health connect introduced a local storage for health data. Though it did not introduce a way to backup and restore these data.
I can't believe Google did not think about that so what's the way ?