Before you pull the old motor take the blower housing off and tag where the wires go.
Magneto, carb solenoid, alternator etc etc
When you put the new engine in pull its blower housing and connect the wires to where they need to go
If the old motor is absolute toast then cut the plug off it with as much wire as you can then cut the plug off the new mower and splice the wires together according to where they need to go.
If you don't want to chop the plug off the use trailer wire take offs