Migrate energy statistics to a new sensor

Hi,

I’m using mariadb as homeassistant database.

Now I plan to switch my sensor for my washing machine and want to keep my statistics. Is there a way to migrate the statistics from sensor A to sensor B?

Thanks