I have done this a lot, I have done it about 3-4 times in the past 3 months alone, upgrading my own and a few family and friends PCs.
The most recent being my gaming computer, as I did not want to download my entire steam library again!
I moved my HDDs from a Windows 10 Machine - HP PC with DDR3 and a sandybridge CPU (i3-2120)
to a Gigabyte Mobo with i7-6700 with DDR4 RAM.
I had a Windows 10 Machine with 2 HDDs.
1 SSD - 256 GB with OS and a few games (games I play more frequently)
1 HDD - 2 TB redirect steam to install older games here and even windows 10 games (gears of war 4 , gears of war ultimate edition, killer instinct).
Clean old software that will not be relevant to the new mobo (in my case HP software).
Attempt to place your Windows OS in "sysprep" mode.
Please google up what sysprep does, it a handy tool, with a few niggling issues, it never works straight away!
Without this step, you OS will most likely not boot in the new environment.
I had numerous issues getting this to work but it always did.
My windows 10 is an upgraded copy of windows 7, by default sysprep will not work on upgraded machines.
Googled up the error code in the log sysprep produced and was able to delete a registry key to get this working.
Issue 2. - Windows 7 will not have this issue.
Windows 10 apps installed by a user, due to Windows Store DRM crap, you cannot put a Windows 10 / 8 OS in sysprep with these installed.
You will have to uninstall all user installed apps from Windows Store before being able to get it in sysprep mode.
If you have multiple users, this will affect every user, it easier getting rid of all additional users too.
The log will tell you what app is causing the sysprep to fail but will only tell you one app at a time, so you can run the tool to identify which app is causing it, but then have to uninstall the said app and run the tool again. I had to do this 20+ times! System Windows store apps like mail etc do not need to be uninstalled.
Once sysprep has completed, please make sure you do not try to boot the HDD now.
If you are migrating HDDs (like I did) please follow these steps, if you are not then skip to Step 4.
Using maricum reflect (free) on a different PC, clone the HDD.
Issues (only if you are changing the boot mode from legacy to UEFI)
I was cloning from a SATA SSD to my new NVme PCI Samsung.
NVme can only be booted in the newer UEFI boot mode, my old SATA SSD was configured to boot in legacy mode.
I had to follow this guide
Then clone the main C:\ partition only (not any system reserved partitions).
Booting will obviously fail, so I then had to follow this guide to fix the booting issues, this bit requires maricum reflect pro.
Time to boot your new machine.
Boot your OS from your HDD/SDD, it will look like a new Windows Build, configure a temporary user, finish the prompts and setup and login once as the temporary user for windows to finish it's driver installs.
Restart, and log in as your existing user.
Install your new Mobo / hardware drivers.
Install your Windows 10 store apps (if you had to uninstall any).
Change your secondary HDD's drive letter to what it was before (in my case my 2 TB HDD was drive E: )
Open steam and continue your game!