Migrating from Raspberry Pi 3 to Pi 4

I see. I don’t use keys, so I’ve not had this issue.

When I say key I mean host fingerprint. A Mac for instance can’t ssh to a Linux host if the fingerprint changes until you delete the old fingerprint.

You will see even in winscp that it prompts you if that key has changed.

I know this is way late, but on a mac you need to delete the “known_hosts” file if it won’t let you connect to your pi via ssh. I do it quite often, happens if I change to a different boot device (SD card) to try something new/different.
Known hosts is in a hidden directory, “.ssh” that you need to find.

I upgraded last night from a pi3 to a pi4, using info from this thread. I made a partial snapshot on my pi3, with all the boxes checked. Made a note of what OS I was using.
I had previously made a sd card for the pi4 with HA running in docker in supervisor mode, so I brought this up on a different ip address.
Both pi’s had samba running, so I used samba to copy the partial snapshot to the pi4. Made sure pi4 was running same version of HA.

Then installed the snapshot, but unchecked the box to install HA itself, left all the other boxes checked.

Once ha was running on the pi4, I moved my zstick to the pi4 and it saw all my zwave devices. Then I changed the static ip addresses in my router so the pi4 took over the pi3’s ip address, and everything worked.

MQTT had a few problems at first, my clients (ESP8266’s in different places in the house) went online then offline. But after a while, this just started working, and it seems solid now.

In the status page which shows CPU and memory usage, on the pi3 the CPU (top row) was pretty high, maybe 50%. On my 2 gb pi4, its really low, 1%.

And it is more responsive. Planning to move boot to SSD next.

This worked great for me:
(I used the 32 bit install, and everything was updated.)


  1. Download the Hass.io image for Rpi4
  2. Image the new microSD card
  3. Let the the Rpi4 boot and sit and download everything

At this point, you’ll be given an option to create a new account, or click a link to load a snapshot.

I selected the Pi3 Snapshot I had saved on to my local PC, uploaded it, and tried to log in.

It burped once (“An error has occurred…”), and rebooted.

After turning it off and back on again,
everything seems to be working fine for my limited installation.

Cheers!

My experience was nearly identical to Elfman’s, with the following differences:

  • 64 bit image of Home Assistant as starting point
  • moving from pi3b+ to pi4 with 8GB memory
  • loaded the snapshot from the pi3b+, including plugins/addons and integrations but not including HomeAssistant
  • I had no errors or issues of any kind at all.

System is running right now with no problems whatsoever.

Dave

Just in case this hasn’t been found somewhere else. As long as you haven’t done anything weird with your DB configuration like another DB handler, You should be fine.
This works for me running:
Going From: Raspberry Pi 3 Model B+
Going To: Raspberry Pi 4 Model B With 8GB RAM
Both Running the following system versions: (IMPORTANT! You MUST be going from and going to the same system versions.)
core-2021.7.1
supervisor-2021.06.8
Home Assistant OS 6.1

Pre-start Note: Make sure to note your hostname and local IP address.
Both can be found under: Supervisor > System - Host.
Simply copy & paste them in notepad. You’ll need them in step 10 below.

  1. Make a Partial Snapshot on old Raspberry Pi 3 (Supervisor > Snapshots) and include everything but HA Core OS. (The first checkbox at the top) You can add a password if you like. HA will not ask for it during restore process.
  2. Once the snapshot is created, click on it and select everything but HA Core OS and if you added a password, type that in.
  3. Click the 3 dots in the bottom right-hand corner and download the snapshot.
  4. Go through the normal steps to install a fresh install on Raspberry Pi 4 UNTIL you get the Onboarding screen. HA - Raspberry Pi
  5. On the onboarding screen, you should see a tiny link at the bottom that says “Alternatively, you can restore from a snapshot.” Click that link.
  6. Upload the partial snapshot you downloaded in step 3.
  7. Again, select everything but the HA Core OS. (Note: It’ll look like nothing happened except you’ll loose connection.
  8. As tempting as it may seem given nothing happens. No confirmation screen or anything. DO NOT UNPLUG YOUR RASPBERRY PI. The system will restart and it will still resolve to homeassistant.local:8123. Be patient. This took about 10 minutes for me.
  9. Once the page loads after refreshing and you may have to clear cache in your browser, you should be presented with a login screen. Log In with your previous credentials.
  10. Once logged in, go to Supervisor > System and change the IP and Hostname to your previous settings.
  11. Restart your system.
  12. If you use Nabu Casa Cloud Service otherwise skip to step 14 - Once everything is up again. Go to Configuration > Home Assistant Cloud. It may look like it’s connected but for me it didn’t work again until I logged out and logged back in.
  13. Check to make sure your Google & Alexa integrations are still working. Mine were just fine and didn’t require any updating, but it can be finicky from my understanding.
  14. Go to Configuration > Integrations and make sure everything is still set up and working. I had to re-log into my Withings Health and Alarm.com integrations. Your experience may vary but it really wasn’t hard. It just took me 30 seconds to do this.
  15. Run scripts and third party or external controllers to make sure they still work. I was worried my long-term token generated for my Elgato Stream Deck wouldn’t work and I would have to make a new one. But, it worked just fine.
  16. ENJOY! The whole process from device plug-in to up and running like usual was only about 40 minutes including restore time and system restart.
1 Like

I’m trying to upgrade from a Pi3 32 bit to a Pi4 64 bit and have been trying your method. Every time I upload the tar file to the Pi4 on the onboarding screen, it uploads and then nothing happens. I heard there is a way to manage it through the CLI however I don’t have an HDMI adapter for my Pi4 so I can’t go that method.

Any suggestions? At this point I’m thinking about just starting fresh with the Pi4 and transferring my config over after the onboarding process is complete.

How long are you waiting? Migration from one type of hardware to another is fairly easy. You may try logging in first and then restore the back up rather than through on boarding. Also it you have ssh installed you can monitor the logs files from cli.

After uploading I left it a few hours and then overnight… no change. As for SSH it isn’t running when you’re at the initial onboarding screen (I ran a portscan on the Pi4).

Edit: I just tried again, and then it goes back to the ‘Upload snapshot’ window

I believe the going back to the upload window is a bug. I reported on GitHub but it was closed an it looks like not fixed. On ssh. You can install this on the new installation, get it working and then install your backup. With cli you can run ha su logs & ha core logs for example and see what is going wrong.

I finally got it to work. I completed the onboarding process then installed the samba addon, copied my backup to the /backup dir and did a restore from the supervisor/snapshot page. It worked like a charm! So I guess something is still really wrong with the setup process that it doesn’t like the snapshots.

FYI my snapshot was about 750mb and the reason I used the samba addon was that every time I tried to upload the snapshot through the web interface of Homeassistant, it would give me a ‘Reconnecting’ message in the lower left as if the homeassistant process crashed during the upload of the snapshot. Very weird!

So something I figured out later is that if you are trying to restore a large backup using the onboarding link at the bottom, it will not work with backups larger than I believe 1 or 2GB. @mzac is correct that restoring after the onboarding is the best route with larger backups.
Also, since then I am now using an SSD for booting the OS and not an SD card. This has vastly improved performance and stability.

Restoring from snapshot will make everthing work in Pi 4 as it did on Pi 3? Zigbee bindings, integrations, lovelace…

Yes it will, even if you change from 32-bit to 64-bit.

2 Likes

I know that this topic is old, but I was searching around for some help as I had recently gotten a Pi4, but was reluctant to change incase of any issues.

The process I followed was to create a backup on the Pi3, download it to the computer I was logged into HA using. I had installed the HA OS using the Pi imager on the Pi4. I logged in, uploaded the backup and restored the full backup.
Once the IP address on the new one matched the old one everything seemed to be working perfectly.
I just hope I haven’t typed this too soon.

3 Likes

You are absolutly right - snapshotting makes no sence - hence that will never work

I’ve just done this migration after reading this thread and some others where there was some conflicting advice about doing a partial backup rather than a full one. It has to be a full backup or you will be missing most of your customisations (DAMHIK).

This is using HAOS and with a static IPv4 address configured within HA. If you’re using static DHCP there would be a couple of extra steps to sort that out. What worked for me was simply:

  • Make sure Pi3 is running the latest of everything
  • Prepare a new SD card with the Pi4 HAOS according to the documents
  • Do a full backup on the Pi3 and download it using your browser
  • Unplug the Pi3 from the network
  • Plug the Pi4 into the network and boot it
  • Wait a suprisingly long time while it’s “Preparing” before the web interface on port 8123 gives you an initial screen
  • Use the option to restore from a backup, supplying the .tar file downloaded previously
  • You will then get a “restoring backup” screen that never completes. However, after some time it has actually completed.

In my case I had the SSH add-on installed, and once that had been restored and started, I could use that to log in and use “docker stats” to see when it looked like the restore had finished.

If you plug in a keyboard and screen during the initial installation phase and/or the restore, you can use the command line to see what’s going on (“supervisor logs”, “core logs”, and apparently “login” will give you a shell on the bare OS).

With hindsight, I feel that this procedure isn’t really well documented/tested enough, as moving from lower to higher powered Pis is clearly going o be a very common operation.

1 Like

I just assume the process should be the same if you use an SSD instead of an SD Card. Can anyone confirm?

Yes, indeed.

1 Like

OK, i would need a second SSD to go this way, right? Or might it be possible in some way to just move the SSD from Pi3 to Pi4?