Replace hard drive whilst saving installed software
I'd say you'd need to clone it.

Clones survive with all pre-registered software still intact. I've been doing this for years across several Macs precisely for this reason.

I'd recommend Carbon Copy Cloner [just because it's the one I'm used to] which is capable of cloning to any drive large enough to fit all the data on; it will be bootable &amp; it will offer to make a new Recovery Partition as part of the process.

On a single-drive laptop, you'd need to be able to get the new drive into an external enclosure before starting. You can also test the new clone is bootable from the external before committing to the final disk swap.