Migrating Home Assistant from Raspberry Pi 3 to Pi 4

Before start … curious about WHY to migrate? 🙂 Read this My Home Assistant server – Raspberry Pi 4

Prepare a RPi 3 Backup

  • Make a Partial Backup from the Raspberry Pi 3: Supervisor Backups CREATE BACKUP and include everything
  • Once the backup is ready, click on it and select everything but Home Assistant Core (first option on top)
  • Click the 3 dots in the bottom right-hand corner and click Download Backup on your PC

Make a fresh RPi 4 Installation

  • Flash a new SD using a Raspberry Pi 4 64 bit image, you can find it at official Home Assistant page https://www.home-assistant.io/installation/raspberrypi
  • Keep the Rpi 4 switched off
  • Plug the SD card on the Rpi4
  • If you are going to use a cabled connection just plug the Ethernet cable and switch on the Rpi4
  • If you want to use Wi-Fi connection instead follow these additional steps:
    • prepare an USB drive whit FAT32 and Volume Label CONFIG
    • create on it a new folder named network
    • create inside the new folder a new file without any extension, name my-network, open it with a text editor and copy and paste following code replacing YOUR_SSID and YOUR_PASSWORD with your Wi-Fi network login
    • Disconnect your USB drive from the PC and plug it on the RPi 4
    • Having both the SD card and the USB drive connected, switch on the RPi4 and wait it to boot and connect to your Wi-Fi network. Be patient this can take a while
[connection]
id=my-network
uuid=72111c67-4a5d-4d5c-925e-f8ee26efb3c3
type=802-11-wireless

[802-11-wireless]
mode=infrastructure
ssid=YOUR_SSID
# Uncomment below if your SSID is not broadcasted
#hidden=true

[802-11-wireless-security]
auth-alg=open
key-mgmt=wpa-psk
psk=YOUR_PASSWORD

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto
  • Use method that you prefer to find out your Raspberry Pi’s IP address (your router control panel or any Wi-Fi scanner tools)
  • Type the address on a browser using this format http://XXX.XXX.XXX.XX:8123 replacing X with your IP
  • Should appears the login page

Restore Home Assistant on Rpi4

  • Click on the bottom link “Alternatively, you can restore from a snapshot”
  • Select the RPi 3 backup (.tar file)
  • Again select everything but Home Assistant Core (first option on top) and click RESTORE
  • Nothing will happens and you’ll loose the connection with the Rpi4 for a while, so be patient, do not switch off your RPi 4 and just wait for around 10 minutes
  • Try to refresh the page, using same IP address as before until should appear again the login page. Pay attention, if you have also installed the SSL, you should now switch from http to https (https://XXX.XXX.XXX.XX:8123 replacing X with your IP)
  • Log In with your previous Home Assistant credentials
  • Finally it’s time to say goodbye to your old RPi3; the last step is to assign same IP Address used for RPi 3 to new RPi4.
  • Switch off the RPi3
  • If you are using any USB device on your RPi3 (like my ConnBee II USB), move them to the new RPi4.

Goodbye old friend may the force be with you

from “Star Wars: Revenge Of The Sith”

Reassign old IP address from RPi3 to RPi4

Since usually many configurations are based on the IP address, simplest thing to do is bring same IP to new RPi4:

  • Go to your router Control Panel. I’m using a Fritz!Box 7530 but take in mind that following steps will change according to your router Brand even if the concept remains the same.
  • Go to Wi-Fi – Wi-Fi network menu
  • Once swiched off the RPi3 will be listed on Disconnected Devices list
  • Locate Wi-Fi entry for RPi3 and click on Delete
  • Go to Internet Permit Access and Delete any entry related to old RPi3
  • Now locate new RPi4 entry, click Modifiy and assign the old IP copyed from RPi3
  • Add new Permit Access for this IP on 8123 port (SSL access for default 8123 Home Assistant port)

Completing installation

Once restarted everything should works like in the old RPi3. Including addons, integration and Zigbee devices.

In my experience I had only a problem with ESPHome addon, which won’t start anymore. The fix for me was to UNINSTALL and reinstall the addon. To avoid any loss of your projects, just backup the config/Esphome folder from your RPi before proceed.