Migrating from Raspberry Pi 3 to Pi 4

You meant downgrade the hassio in Pi 4 to the same version as Pi 3 hassio? May i know how can i downgrade the Hassio version? Through snapshot restoring?

Via the command line interface. Can’t recall if you can do with backup directly.

Via CLI, have a look here:

Just install an addon that allows SSH

Y’all I am hitting a brick wall here, please help.

I have the full snapshot from my RPi 3B+, and HomeAssistant is installed and updated on my new RPi 4.

For the life of me I cannot find a way to get the snapshot onto the new RPi 4 system. I’ve tried Samba, SSH+Terminal – both throw out constant host key problems. I’ve generated new keys and verified all are the same, no luck. My Mac will not SSH into the new system.

I’ve tried the File Editor add-on – it allows uploads of seemingly anything, except for the 27MB snapshot, and won’t budge.

“ED25519 host key for 192.168.0.103 has changed and you have requested strict checking.
Host key verification failed.”
That’s the error I keep getting when trying to SSH.

I just need to get this snapshot to the new system so I can stop dicking around with the settings on this new install.

On day 3 of this, Frustration level: 8

Which SSH add-on are you running? I use the SSH & Web Terminal add-on, with config that looks like this.

ssh:
  username: MY_USERNAME
  password: MY_PASSWORD
  authorized_keys: []
  sftp: false
  compatibility_mode: false
  allow_agent_forwarding: false
  allow_remote_port_forwarding: false
  allow_tcp_forwarding: false
zsh: true
share_sessions: false
packages: []
init_commands: []

You can then use a program call WinSCP to connect to the machine via SSH and copy the backup to /backup folder. Have a look HERE for a little more info.

I am also using SSH & Web Terminal, which works fine on my RPi 3B+ install

It’s the only add-on I’ve installed on the new RPi 4 install, and this is the error I keep seeing:

Add correct host key in /Users/brymc81/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/brymc81/.ssh/known_hosts:6
ED25519 host key for 192.168.0.103 has changed and you have requested strict checking.
Host key verification failed.

What does your config look like?

Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa

That looks completely different from what I posted above. Are you sure you are taking the config from the add-on?

It should look almost identical to what I posted above. Keep in mind there are 2 SSH add-ons, perhaps you are using the other one.

Use this one.
Capture

Not this one.
Capture2

His issue is the host key has changed
 so he needs to delete the old one so a new one will be accepted.

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!