You need to plug the old HDD from that computer into your new one, boot from it (to Windows) and extract the key from it:
How to Find Your Lost Windows or Office Product Keys
Then wipe that old HDD assuming you don't have anything else on it you need and in the new HDD (the new computer) setup Windows using the license key you extracted from the above tutorial.
Then you're set