Energy data from two different sources. An old Shelly and a replacement

Hi. I used a Shelly EM Gen 1 for ages to monitor my solar and grid energy. Dashboard updated lovely. However EM has failed and I’ve replaced with a Shelly EMPro. All setup and working on the Shelly app. Came into HA, added the new device, deleted the old one and reconfigured the Energy dashboard. That’s when I noticed that my multiple years of historical data has gone!

I suspect when I deleted the old EM device, I have deleted the data? Or is it the fact I’ve removed the old entities from the dashboard config?

Is there any way I can get this data back? I don’t particularly want to see a load of errors on the Shelly integration for a device it can’t find, but if that is the price then so be it…

Thanks for your help and comments

To get the data back you will have to restore a backup from before you deleted the device.

Then add the new device and don’t delete the old one.

thanks. will give that a go.