You have to use disk cloning software to clone RAW partition onto the second PC's disk or to a virtual hard disk.
I can recommend Acronis TrueImage, you can get a free trial. Your HDD's manufacturer may provide an unlimited free version of it too, but keep in mind that it will run only on machines with that manufacturer's disks, so you'll need such disks in both machines or You'll have to clone to a virtual HDD. The popular free tool Clonezilla probably won't work in this case, it usually fails when cloning to another HDD.
Whatever tool you'll decide to use, you'll have to create a bootable CD or pendrive (or just ISO, if you want to clone to a virtual disk).
Cloning to second machine's physical hard drive
- Copy your VM's folder to the new host.
- Create an image of the old raw partition with some disk cloning software.
- Move the image to the new host.
- Use the same program to restore the image to the hard disk. You may have to create appropriate partition first.
- Make sure Windows detects the new partition: press Win, type
diskmgmt.msc
and press Enter. Partition should be marked as healthy. If a drive letter is assigned to it, remove the drive letter and reboot.
Recreate VMDK file:
- In the VM's folder delete MyDiskFile.vmdk and MyDiskFile-pt.vmdk
- Run elevated command prompt: Win,
cmd
, Ctrl+Shift+Enter, confirm UAC dialog
Change directory to the VirtualBox application's directory:
cd C:\Program Files\Oracle\VirtualBox
List all available partitions: (adjust drive number)
VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Cloning to a virtual hard disk
On the old host, open VM's settings in VirtualBox. In the Storage section, attach a new hard disk. Make sure it's big enough to fit all data from your raw partition.
Load your bootable ISO into the virtual optical drive.
Boot the VM. On the VirtualBox logo screen press F12 and then C to boot from the ISO.
Use your disk cloning tool to clone raw partition to the virtual disk. You may have to create a partition first.
Setting up new host
You can load the VM on your new host by choosing Machine → Add... in the VirtualBox's main window. It will appear on the list of VMs.
VirtualBox may complain about unrecognized disks or incorrect UIDs. If this is the case, use Virtual Media Manager (File menu in the main window) to detach problematic disks. You'll have to attach them again. If you won't be able to do it, you may have to detach disks before copying VM to a new host.
Windows should work on the new hard drive (physical or virtual) without any adjustments. A balloon notification about new hard drive may pop up asking you to reboot. It's not urgent, but may improve performance.
Remember that you have to remove the VM from your old machine to avoid violating Windows license.