How can I reinstall Home Assistance and transfer all data from Iammeter

Hi.
I need to reinstall Home Assistance and I’d like to transfer all Iammeter’s data.
How do I do it? I have statistics since last year.
If answer to this question has already present, please give me link.
Thanks.

If running HA OS, simply restore a backup.

if running HA core, Copy all files in the config folder?