Rename/Migrate stats entity

This is a bit similar to https://community.home-assistant.io/t/add-a-method-of-replacing-devices/

Notably, it’s related to this comment: Add a method of replacing devices - #3 by Creeju

Use case:
When I used a zigbee socket plug for energy monitoring of a device I later replaced it with an integrated zigbee relay. It’s the exact same situation but a different device.
After reconfiguring HA I’d like to keep the old energy stats related to the old device visible, but since the device doesn’t exist anymore I’d like them under the same entity.

It would be great if instead of just removing the old entities we could remove it and rename all existing stats to the new entities.
This would preferably be done in the Developer Tools > Statistics tab when clicking “Fix issue”.