All energy history disappeared

finally I found this post

that allows you to load metrics from a custom service on the DB.
if you look in the latest answers I also put a python script that extracts a metric and prepares it for loading. obviously only those of type energy.