Just be sure to back up your PC before you replace your hard drive.
Therefore, you shouldn't run into any issues when you change your hard drive. The motherboard is the only part of your PC that if changed will invalidate your Windows digital license. The only issue you may run into with swapping out PC hardware is if you change the motherboard. I happened to find a Microsoft answer forum that offers a detailed explanation of Windows digital licenses. If you upgraded from a previous Windows version (Windows 7 or Windows 8) to Windows 10, the license you were previously running is exchanged for a diagnostics product key. If you are a current Windows 10 user and you want to upgrade your PC's hard drive, you should be able to do it without any issues with your Windows 10 digital license. Your Windows digital license is the unique signature that is given to your PC by Microsoft and stored on Microsoft Activation Servers. If you decide to change a hardware component of your Windows 10 PC, you should not run into issues with your PC's digital entitlement (also known as a digital license). Here's how I managed to re-install Windows 10 to my new hard drive. However, after installing the new hard drive, I was unable to re-install Windows. I was able to create a system recovery USB before the old hard drive failed completely. I recently bought a new hard drive for my Windows 10 PC because the previous one stopped working.