Hi ,
Please find the below details .
If you have vCenter server 5.X and shared storage you can do migration live .
In case you have shared storage and no vcenter you can install new vcenter in evaluation mode do this online .
Or Present the Shared storage to esxi 5.0 , power of VM from 4.0 , register the vm to esxi 5.0 and power on . (Select move option while there is Waring popup comes)
If you don't have vCenter and Shared storage .
You may use vmware standard converter for moving vm from 4.0 to 5.x .