i copied the vm from esxi converted to vhdx but when i tried to run it it didnt boot up.
Some details may help. Any warnings, error messages? What exactly happens?
its uefi win 2012 server r2. (need to keep it running on hyper-v to build server 2019 on esxi)
Just to understand this. Are you trying to run the VMs on a virtualized Windows Hyper-V 2019 that's running on ESXi?
Once you answer the questions, I can/will move this discussion to the appropriate community,
You would be better asking this question on a Microsoft forum.