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 youfrom “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)
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.
This did not go as smoothly as your post made it seem. After doing the restore at the initial screen, I wasn’t presented with a login prompt. It still wanted me to set up a login. So I did that, but once I got in I didn’t see much restored at all.
My ZwaveJS addon simply didn’t restore at all. I did a bunch of stuff but what eventually copied my security keys was to manually install the addon, then selectively restore just that addon from the backup. Then I had to manually install the integration.
So I’d caution people to keep both pis running so you can hopefully swap back and forth while setting the new one up.
Finally, if you reserve the IP on your router like I did, that doesnt necessarily mean it will get ip. I still had to go into HA’s setup and specify the new IP I wanted there too.
I followed your direction on not backing up the HA core part, but I’m not sure why we were doing that. Why can’t we just do a Full backup and restore that?
I usually backup and restore only the data and not the OS because of issues that can be raised having the fresh installation using a different OS version that the OS version in the backup.