Replace device

I am struggling with the need to replace the device that reads data from energy meters. The replacement of the device itself may happen frequently, e.g. as a result of damage, modernization, or extension of capabilities.
The problem starts when I want to have historical data in the new device.
Currently, it is quite complicated and fraught with risk.
The functionality of replacing a device while keeping the entiti id of the old device would be great.
This applies to HA as well as esphome.
What do you think about making life easier?

I think it is sorely needed. You can vote for this feature request here: Add a method of replacing devices