For those which make use of only the free hypervisor from VMware the following procedure may suite your migration needs – from one datastore to a second one. Both datestores are on the same machine. This procedure has been tested on ESXi 5.5
Please beware to perform the necessary backups before attempting to work directly with virtual disk files: vmdk.
I do not take any responsibility and I am not liable for any damage caused by following this guide.
1. Create the directory on the destination datastore
You have to use SSH to get access to Command Line Interface (CLI) of the ESXi server.
If the connection is refused, check in vSphere Client if the SSH service is enabled.
You may check this at Security Profile section.
cd /vmfs/volumes/ cd /vmfs/volumes/Storage/ /vmfs/volumes/Storage # mkdir Exchange
2. Clone the virtual disks
/vmfs/volumes/Storage # vmkfstools -i ../ESX-Storage/Exchange/Exchange.vmdk Exchange/Exchange.vmdk -d thin Destination disk format: VMFS thin-provisioned Cloning disk '../ESX-Storage/Exchange/Exchange.vmdk'... Clone: 100% done.
3. Copy the configuration files
/vmfs/volumes/Storage # cp ../ESX-Storage/Exchange/Exchange.vmx Exchange/ /vmfs/volumes/Storage # cp ../ESX-Storage/Exchange/Exchange.vmxf Exchange/ /vmfs/volumes/Storage # cp ../ESX-Storage/Exchange/Exchange.vmsd Exchange/
4. Remove the old VM from Inventory
Notice: Do remove the entry from Inventory and do not delete the VM itself, with all its data on old datastore. You may need these files if something goes wrong with the migration.
5. Add new VM to Inventory
6. Start the new VM
Check if in the vSphere client, for the machine you have just migrated it would ask you if it has been moved or copied.
If it does ask, choose moved option.
That’s it, hopefully you had smooth migration.