Energy database backup

Hi everyone,
I’m Fausto and I write from Italy.
Soon I will have to migrate my HASSIO configuration from raspberry to minipc, and I read in the forums in Italy that in the transition, the energy dashboard data database is ruined, and all the data is lost.
I would like to ask if it is possible to make a manual backup (copying the file or folder, perhaps using FILE EDITOR) of this data so as to be sure not to lose it.
Can you tell me where this database is located?

I hope you can help me.
Thank you

The only data you lose is that which would be captured between the backup and the restore. So if it takes you (say) 30 minutes between the backup on one machine and restore on another, then you will only lose 30 minutes of data - obviously all data, not just energy data.

You could minimize this time by leaving the Pi running, then after doing a full restore to the minipic, stop both HA instances and just copy the home-assistant_v2.db file over again (assuming you’re not using a different database engine), and then start HA again.

Ok, thanks for the reply, so the database file is “home-assistant_v2.db”.
The problem that I often read in the forums here in Italy is that, when the backup is restored (from Google Drive for example), the energy data database is corrupt, so Home Assistant creates a new one, but EMPTY.