TLDR: there is no easy way. But is possible.
If You simply try to upload an VKRC2 program on a VKRC4, robot will refuse it.
VKRC4 has more parameters than VKRC2, and VKRC robots have more hidden instructions than a regular KRC robot. But since VKRC modules are plain text files, You can try to do some sort of search and replace operation by hand.
Other option would be try some specific third party program, like Dramat, Tekrob or Steineke editors, that are designed to work with files from VW robots and can perform these changes in a way or another. Tekrob has an specific VRKC2 to VKRC4 import feature, and with some workarounds, Dramat and Steineke can understand this situation and convert files properly. But all these programs need paid licenses.
And, finally, If you have access to Process Simulate and the proper licenses, You could try to upload the VKRC2 program inside Process Simulate, change software version and download it in VKRC4 format.