Moving the Windows Server from one computer to another

Solution 1:

If it's only Active Directory that you want to move then one possible solution can be is to install a secondary Domain Controller(DC) in your VM, transfer all FSMO Roles to the VM and then demote your older DC.

Check the following links for step-by-step process

Adding a 2012 Domain Controller to an existing Domain

Demoting a 2012 Domain Controller

--Edit--

Reading @sam_pan_mariusz's answer reminded of the Feature "Windows Server Backup" which also does a image based backup of your entire server with all files, configuration and everything.

This image can be restored to a bare-metal hardware(in your case a VM).

As highlighted by @sam_pan_mariusz you'll have to install the new hardware's drivers before the backup.

This Microsoft page on Windows Server Backup (along with the nested pages) has all the details you need to know.

Hope this helped.

Solution 2:

The answer by @23Stinger is the best option, but if you really need to move the existing OS to a new hardware it shouldn't be a big problem.

Since Windows Vista (and Windows Server 2008), moving installed Windows instances between different hardware became much easier. Previously, to run Windows XP, Windows Server 2003 and older on a different hardware, you basically needed to introduce registry entries related to your new disk drive controller driver plus copy corresponding driver files from install media. There were also issues when moving between AMD and Intel CPU, which often required removal of some files or registry entries related to intelppm driver. Failure to do the above steps led to BSOD during startup, due to inaccessible boot device or critical driver error. This article extends the legacy topic.

Currently, with Windows Vista and newer, all you need in most cases is to move your hard drive and boot. It will take much longer for the first time and you will definitely need to reboot once or more. Some of your new hardware may also require new drivers - it's smart to install them before you proceed, as your new NIC or USB controller may not be available without it. It is also possible that some old drivers will critically fail with new hardware (ending with BSOD), check this SuperUser topic how to find out which one you need to hide - renaming the corresponding driver file should change the error to non-critical. When your system finally boots, check Device Manager for missing drivers. Your IP configuration will also need to be adjusted (NICs will loose the settings), and I'm not sure how this change is gonna play with domain services (AD, DNS, Kerberos specifically), so it may need additional reading.

Of course, you don't need to use the same hard drive to boot new server, it's indeed safer to bit-copy the old system to new storage. USB disk adapter can come handy. Boot a live Linux system like ie. Knoppix and use fdisk /dev/DEST_DISK (for MBR partition table) or gdisk /dev/DEST_DISK (for GUID table) to recreate identically-sized partitions and dd if=/dev/SRC_PARTx of=/dev/DEST_PARTx to copy data. Using fdisk -l /dev/SRC_DISK / gdisk -l /dev/SRC_DISK lists exact partition sizes. If the entire procedure sounds complicated, use a dedicated tool like Image for Linux (free, fully functional 30-day trial available), which also contains TBOSDTS tool that may help to solve critical errors triggered by hardware and driver incompatibilities.