Hi larwat, welcome to the Forum.
Installing an old HD in a new computer will have many problems & may not work at all. The motherboard on the new computer will require different hardware drivers to be installed.
The correct procedure is to do a fresh Operating System installation. You will also have to reinstall all you other software programs, but you can copy your data files from the old drive & paste them into the new one.
If the copy of your Windows 7 has been used before you may have an activation problem, depending on what classification it actually is, like Retail, OEM System Builder, or OEM-SLP.