Internal HDD VS External HDD startup
When you have the new HDD installed in the computer you should be holding down the option key when you boot the machine.  This will bring you to the startup manager and allow you to choose to boot from any drive connected that has a bootable OS installed.  Select the internal HDD.  Once you get to the desktop open System Preferences > Startup Disk  and permanently choose that drive to boot from.

https://support.apple.com/en-us/HT204417

If the drive does not show up in the Startup Manager, then you have a problem.