Hi,
I’m running HA on a RPI-4 for a while.
However, I want to run the config on an (old) laptop that will be dedicated as a hass-server.
In the past, I had some problems when backup/restore from one RPI to another one, see also Backup/Restore · Issue #76554 · home-assistant/core (github.com)
To avoid these issues, I now want to copy my configuration manually from the RPI4-supervised to an Intel-X86-Hassio server…
- The RPI4 was configured with DietPi-OS (minimal rabian) and with HomeAssistant Supervised
- On the X86, I will run HASSIO OS.
Copying the config files between the shares
from
\\RPI4\disk01\usr\share\hassio\homeassistant
to
\\X86\config
was a piece of cake.
Than, I added my addons manually on the X86. No problem to set the config there manually either.
But… I want to have the data of some addons here too. I.e.: I added InfluxDB, but want to get my historical data that was build on the RPI4. The zigbee2mqtt addon contains a local database of entities, nginx has all the certificates, etc…
On the RPI4, (thus with raspian + HA Supervised), the addon data/config could be found on
\\RPI4\disk01\usr\share\hassio\addons
Where can I find this info on the X86 with HASSIO OS?
\\192.168.4.18\addons
seems to be empty, although my InfluxDB has already some data somewhere…
So my question: what is the best way to copy my whole RPI-Supervised-instance to an X86-Hassio-instance?
kind regards,
Bart
A HASS backup is just a tar file of tar files - take a full backup on the source machine, and try using tar to unpack the resulting file and explore. By maintaining the directory structure, you can remove parts of the backup then create a modified tar file for the new machine.
You could try using a command line to create a similar backup, but that’d be very hard work.
Hi @FloatingBoater ,
yes, but this tar has a flat structure, in my case:
I![2022-12-22_23-44-15](https://community-assets.home-assistant.io/original/4X/f/c/c/fcc93614cbbcdbadf35159f66b58df1e8c55d1ae.png)
So, my influxdb is in
a0d7b954_influxdb.tar.gz
but I have no idea where to restore this on my HASSIO machine.
On the old machine (homeassistant supervised), the location for the files in this zip file would be
/usr/share/hassio/addons
but on the hass-os, I have no idea where this location is. If I take a look at the samba-share “addons”, this is empty, altough I already haved installed InfluxDB manually. So I gues the data is stored somewhere else.
My suggestion was to modify the backup file and restore with the HASS tools - not manually.
As an example, when the media player Add-On was released, I tested a couple of MP3 albums which increased the size of a full backup considerably. The HASS restore tool couldn’t cope, and died. I just edited the backup TAR manually to remove the component with the MP3 media directory, and restored the much smaller HASS backup normally.
Expand the main backup file. Copy the component you wish to trim to a tmp
directory, unpack, edit, repack, replace. Repack the main backup file. To restore to a new machine, you don’t need to know where components go - HASS already has a well tested system for backup restore. Use the existing tools to your advantage.
Editing the main database itself (i.e. not a 1:1 old to new restore) can also be done using the SQL web add-in (I’ve done this to remove bad sensor values). Sadly, I know nothing about influxdb nor grafana, but would expect it to be possible to use the TAR backup to build something to edit it and import.
As an ex-DBA, export/ transform /load was a regular task, but the trick is to always have several backups at each stage so when you learn something has broken, it’s not that hard to fix.
What I don’t know is if it’s easier to add historic data from a flat file export/ import or live into a running database, however a straight backup/ restore of an individual component shouldn’t require this.