I did this before using File → Export OVF Template (make sure the virtual machine is offline). You can then deploy this to the new system using "File -> Deploy OVF Template". I highly recommend that you test this before destroying your old system, as there were times when it didn’t work correctly.
If you need to do this without shutting down the virtual machine, I think it will be much more difficult for you, but you can do this by installing a temporary / Demo vCenter server, connecting ESXi to it (if you are still in a demo license that allows you to obtain a new license that permits it), then clone the running virtual machine and export to the cloned virtual machine.
source
share