I installed Home Assistant on a old computer with Ubuntu server back in 2016. Lately they have released Hass.io, HassOS and changed the name of the basic Home Assistant to Home Assistant Core… I think… There has been a lot of names to keep track on here.
I believe I had Home Assistant Core and migrated to HassOS/Hass.io now.
My goal was a dedicated box for the smarthome-stuff, with so little effort as possible. I have tried Raspberry Pi, but it was slow and the SD-card always dies sometime – So Intel NUC was the obvious choice, as it has a dedicated HA-image… but it wasn’t that simple…
How to migrate or move HA in short words
- Copy the whole HA-config folder from your old/current installation.
- Install/setup HA on a new computer.
- If you are installing HassOS, you probably need to create a user in the new HA, to install Samba or something that gives you access to the new HA-config folder.
- Copy the old HA-config content into the new HA-config folder.
Simple right? Yes, but we must setup/install the NUC first…
A lot of failed attempts
I downloaded the Intel NUC image and flashed that to a USB-drive with balenaEtcher.
Putted the USB-drive into the NUC and … nothing… Tried to read the installation manual on HA many times but did not get any wiser.
After some googling, I found out that the NUC image is only a image. That means no «Installer». So I need to flash the SSD with the image file.
One solution is to put the SSD into my own computer and flash it there, the other solution is to boot the NUC with a Linux Live CD and flash it from the file on a USB-stick.
This is not easy or «little effort as possible» in my mind. It will be a «project» getting up and running again if my NUC fails.
At this time, I considered a Ubuntu as main OS with Proxmox and supervisor setup – but that would also require a lot of time and configuration.
I decided to boot the NUC with a Linux Live CD and try to flash the image from there. I found own instructions for Intel Nuc and Ubuntu – but those instructions are only for installing Ubuntu… not a live CD. So had to download and flash the standard Ubuntu Desktop image to USB with Rufus.
How I installed HassOS on the Intel NUC
I got some help by reading this forum threads:
- My steps to success for Hass.io on Intel NUC
- Absolute Beginners guide to installing HA on Intel NUC using Docker
Download Ubuntu Desktop image.
Write the Ubuntu image to USB-drive with Rufus.
Put the USB-drive into the Intel NUC and boot from it. You maybe need to turn off secure boot. I also updated the Bios, as that was recommended several places. See below for how to disable secure boot and update the Bios.
Just start Ubuntu without installing it.
Open Terminal on the Ubuntu.
Write the command below into the terminal. Remember to change it to your own locations.
gunzip -c /media/ubuntu/CPBA_X64FRE_NB-NO_DVD9/hassos_intel-nuc-4.11.img-gz | sudo dd of=/dev/sda
This took some minutes. Unplug the USB-drive when finish and restart.
Once you are up and running, you can visit you Home Assistant by entering the it’s IP-address in your browser.
You have to create a new HA-user to login. After you are logged in, you can activate Samba to get access to the HA-config folder.
Did it all work?
Yes and no. I had to check the home-assistant.log to fix a lot of small issues.
One of them was to recorder, that was pointing to a database that didn’t exist anymore.
I thought I would just install Deconz from scratch, as I had 5-6 lights in there. But I couldn’t find a guide to reset the Philips hue bulbs without a remote or exclude them from the controller. I had to fire up my old HA-computer to take backup of the Deconz database and import in my new setup.
Deconz also acted up. It couldn’t find new lights and they who where imported didn’t work. After some googling, this looks to be a general issue. By importing the config once more, it worked fine.
Backup database from MySQL in docker?
I had Home Assistant running in Docker. My data was stored in MySQL, also running in a docker-container. To back up the database, you can run this command.
root@homeassistant:/home/robert# docker exec 35f4b4f0f88c /usr/bin/mysqldump -u homeassistant --password=MyHomeAssitantPassword homeassistant > backup.sql mysqldump: [Warning] Using a password on the command line interface can be insecure. root@homeassistant:/home/robert# ll total 7438168 drwxr-xr-x 12 robert robert 4096 Jul 31 00:34 ./ drwxr-xr-x 5 root root 4096 Jun 11 2019 ../ -rw-r--r-- 1 root root 7616608895 Jul 31 00:37 backup.sql
Disable secure boot on Intel NUC
- During startup, press F2.
- Click advanced in the Bios. Then Boot > Secure Boot tab.
- Uncheck the Secure Boot option.
- Press F10.
- Select Yes to save the settings
Update Bios on the Intel NUC
Basically, add the .bio file to USB-stick, press F7 on NUC boot, select storage drive and press yes.