We need the following info to give you a logical answer.
Model number, type #, code # of the removed engine.
Same info from the installed engine.
Name and Model number of the machine (tractor).
Hope you have not already burned out the ignition coils.
If it's cranking and no spark, you need to...