I did this awhile ago, no problems on the Ubuntu side, but did have to reinstall windows. So from memory and a few notes: Step 0 is backup and test your backups by trying a restore to see if that works.
- Shrink the last partition and the extended partition to give some unallocated space (33 sectors +) at the end of the disk for a backup gpt partition table. Easy.
- Windows reinstall created another efI partition, so be prepared to deal with that. I created an EFI partition (type EFI, boot, esp flags), populated it with the shimx64.efi, grubx64.efi, grub.cfg stub linking to the maintained grub.cfg in the Ubuntu root, and then set up the default bootloader for the device, /EFI/Boot/bootx64.efi as a copy of shimx64.efi, had grubx64.efi in the Boot directory also, so no nvram entries needed, just boot the device.
3)Ubuntu should now boot in UEFI mode UEFI! Even with the old legacy grub.cfg file! Probably a good idea to install the grub-efi package to reinstall grub officially. Note I could not get Windows to boot (directly -- of course the legacy grub chainloader syntax would not work).
4)Reinstall Windows, and it makes another EFI. Copy over the files needed to the EFI you want to use from the other EFI.
Basically, most of my problems in the conversion were from Windows.
But I'm not proficient in what Windows requires/uses for booting so maybe that's expected. Recently, I did try a disk clone, trying to add an EFI partition to a gpt disk that didn't have one, but couldn't get Windows to boot off that EFI (had a second boot disk). Basically gave up trying to make the EFI partition first on the new disk, and will at some point, add it to the end.