That's just the first hurdle. Now the used ECM will need to be cloned to the original one, as it holds VIN and key info. There are many options, none of which are perfect or necessarily very affordable. Dealer is ridiculously expensive because these ECMs are designed to prevent VIN swapping after the first VIN installation, so dealers want to sell a new ECM.
You can send the two ECMs in for cloning but it's still quite expensive, my cost around $500. You can use a Carpro clone to swap the data directly between the EEPROM chips, but it's quite complex and sometimes you have to actually physically remove the chip off the PCB before you can write data to the chip (which is why the dealer can't write to the chip themselves using their OBD2 tool).
You can physically swap the EEPROM chips - not a big deal as they are just surface-mount 8 pin chips, but apparently you can sometimes lose the Key data so it still won't start and you now have to hire a locksmith to recode it to your keys.
(Note that I suspect this data loss may be caused by the manner in which they usually remove the EEPROM chip - heat the whole thing with a heat gun until the solder melts. You've already got the data in your Carpro from the old ecu so it doesn't matter that you damage the data in this EEPROM. Once removed, the EEPROM is flashed and when it's remounted a soldering iron is use to quickly resolder the pins back on so it's much more gentle to the chip.)
Safest is sending it out, but most non-dealer expensive.
Less safe is buying a Chinese Carpro clone, which preserves the data of the damaged ECU. Problem is these things can be sketchy and have been frequently known to not work or even rarely brick your ECM (though this might be user error). At least you can get your money back!
Cheapest and quickest is to carefully and gently swap over the EEPROM chip and hope you don't lose data. If you do, still looking at hundreds for a mobile locksmith to recode the thing. (I recently had an all-keys lost situation that cost $600 to rekey by a mobile locksmith). Needing a rekey can make it close to the cost of just sending it in for cloning. But that could take weeks, and I need to get this back on the road. And I hate paying someone to do stuff I should be able to do myself.
Decisions, decisions.
Just found the EEPROM:
That's a tiny bugger
