My recommendation is to use Macrium Reflect Free https://www.macrium.com/reflectfree
Install the program and create a Rescue DVD or USB flash drive, also you will need an external HDD to store the backup image
- boot the machine from the Macrium Rescue, during the loading process connect the external HDD
- create a backup image (not clone) of all the disk partitions to the external HDD. The external HDD can have other files, the backup is stored in one or more big files without affecting the existing data
- shutdown the machine and install the new HDD
Repeat the process but this time use the option to Restore the image created before and select the new disk as destination.
The Macrium Reflect webpage have several guides about how to use the software.