Migrating from Raspberry Pi 3 to Pi 4

Hi guys. I am running Hass.io on a Pi 3 and it has been great. I recently got a new Pi 4 and want to move Home Assistant over to that. Can I just move the micro sd card or do I need to start over with the Pi 4 image?

Kevin

No you canā€™t. There are different images for the model 3 and 4.

Flash a new image and restore a snapshot.

1 Like

Iā€™m also thinking of grabbing a pi4 as I have a feeling that the extra RAM and CPU cycles would help my setup as I have a lot going on in nodered etc.

Can I literally just copy and paste the old config directory across to a newly setup hassio, or is there more to a snapshot than that?

A snapshot is not the same as copying over the config directoryā€¦

1 Like

Here is what I did.

  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
  4. Make a snapshot on the Rpi3 and download it
  5. On the Rpi4 install Samba Share and copy the snapshot into the backup folder
  6. Reboot the Rpi4
  7. Restore the snapshot on the Rpi4
  8. Shutdown the Rpi3 and change the Rpi4 to have the IP of the Rpi3

I was expecting that the Rpi4 would be faster but I wasnā€™t expecting it to be this much faster. The HomeKit integration is where I notice it the most. Siri responds almost instantly now. My wife even noticed and commented on home assistant being faster. I highly recommend it.

16 Likes

My pi4 upgrade made a huge difference. I also recommend using a SSD instead of running Home Assistant from an SD card.

Itā€™s good to hear that there are noticeable gains!
What flavour pi4 did you go for?

Also - I thought SSD compatibility was just on the pi3?

Would you please let us know how are you using an SSD drive with your RPi4? Thank you!

1 Like

Well, currently the proper USB boot capability is not yet available, there are workarounds. Basically you boot from the SD card, but all the relevant files are on the SSD. I recommend this USB-boot tool (itā€™s a script that does everything for you that you would otherwise would have to do manually). Itā€™s pretty neat because you can even move your existing SD card installation onto an SSD (but itā€™s fine if you just have the OS on the SD card so far). It only takes a few minutes and it works perfeclty. It was updated to work with pi4 although it was originally made for pi3.

2 Likes

Great!! I truly appreciate the info!

Iā€™ve been looking into doing this and the normal guides talk about either ā€˜specific compatible drivesā€™ or changing the ā€˜systemā€™ location in fstab or in cmdline.txt

Iā€™ve not seen this script before but the instructions are a bit vague.
I assume youā€™d need to change ā€˜somethingā€™ on the sd to have it redirect (for unattended boots) but I donā€™t see how it does that.
Would you be amenable to write up a pi 4 ssd hassio / ha installation ? (or should that be using the new naming as announced today.?)

I can do that (although I dont know when). The instructions of the script are vague, but once you actually run the script itā€™s pretty straight forward.

I run Raspian Lite with Docker and Hassio. I can give you a quick and dirty guide now:

  1. Flash Raspian (Buster) Lite on SD card (e.g. with etcher)
  2. Enable SSH by adding ā€˜SSHā€™ file on SD card
  3. Insert SD card into pi and boot
  4. SSH into pi
  5. Copy usb-boot from PC onto your SSD
  6. Attach SSD via USB to the device. Copy the usb-boot files onto your SD card
  7. Run usb-boot and make SSD boot device+copy files from SD card to SSD with the tool
  8. Install Docker sudo curl -fsSL https://get.docker.com | sh
  9. Follow hassio-installer instructions:
    9.1 installl dependencies (via sudo apt-get install)
    9.2 Enter sudo su to get root access
    9.3 Run curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh | bash -s -- -m raspberrypi4
  10. Done!
  11. Set up samba
  12. Set up backup (e.g. the Google Drive Backup-Addon)
3 Likes

You Sir are a gentleman and a scholar !
I thank you
Iā€™ll give it a go on both a pi3 and a pi4 and report back with questions / snags
Cheers :beer:

1 Like

Well I have used a small external hard drive in the usb 3 (waiting on another ssd adapter, as last one wonā€™t even let the pi boot). And have it running on a pi 4 with everspring z wave stick plugged into a USB 2 port.
Everything pretty much as you describe. Though some comments to make it more accessible to all : -

  1. Iā€™d copy the USB-boot.zip onto your computer then move the two scripts inside to the sd boot drive at the same time you write the ssh file in there
  2. Move the files to a directory (I used - mv /boot/usb-boot /bin/ but perhaps another location is better ???)
  3. Then do a chmod +x on the script to make it executable
  4. I formatted the USB disk when connected to the pi (had some issues with externally formatted partions before, not many but enough to be cautious)
  5. emphasise that ā€˜spaceā€™ is used to mark options in the script

Not sure about : -

  1. I set up ssh on raspbian so I didnā€™t bother setting it up as an addon in hassio
  2. Samba, really confusing, set it up on raspbian and pointed it at the required folder (canā€™t remember which one as donā€™t have my notes with me, but itā€™s certainly not ā€˜configā€™) anyway set this up in raspbian, added users and passwords - didnā€™t work. Set it up in hassio - started working. Stopped it in raspbian - didnā€™t work again. It needs BOTH to work ??? Donā€™t understand that, maybe I made a mistake ?

All in all the best and the closest Iā€™ve come to getting it running with an external drive - my thanks

Metric.			pi3		pi4

Checkconfig		24s		8s
Reboot			198s	215s ???
Restart			will edit this later when I do the tests
Reload autom
Reload scripts

All below here is additional (the forum platform must think cib and I have a bromance as itā€™s objecting to me posting again, ā€œlet some others join the conversationā€ :rofl: )

Samba : - hahaha well Iā€™ve been using samba for about 20 years (used to build my own NASā€™s) so I will always find a way ! Never thought of putting samba in its own docker though. Its so easy to restart anyway I donā€™t think Iā€™ll bother with that.
No, I was more concerned about newbies following instructions to get to share the ā€˜configā€™ folder (not only that but the other folders ā€˜beneath thatā€™ like backup etc.
I see you set it up with the username ā€˜userā€™ which is the same as hassio was created with, but mine didnā€™t complain when I used another name.
I think a simple setup for most newbies will be fine in the instructions. Advanced users can meddle to their hearts content.

So you can either use the Samba add-on (which is enough for most people) to edit your config files etc., or you can setup regular samba in rasbian directly. Since I also had troubles setting it up (was my first time), I ended up using a dockerized version of samba (I also have another external HDD in this setup):

sudo docker run -d -p my-ip:445:445 \
  -v /mnt/Seagate:/Seagate \
  -v /usr/share/hassio:/Hassio \
  --name NasPi trnape/rpi-samba \
  -u "user:password" \
  -u "guest:guest" \
  -s "Seagate:/Seagate:rw:user" \
  -s "Hassio:/Hassio:rw:user"\

No way to migrate from pi3 to pi4 with snapshot.
I did a full snapshot on pi3 and moved to pi4 then first I tried with wipe and restore but the pi4 stuck as it was a new installation then I tried simply ā€œrestoreā€ and HA never restart. I deleted the DB as suggested but same result the GUI doesnā€™t bring online.
Any suggestion?

thanks

1 Like

Same for me. Followed the steps but now doesnā€™t come up :pensive:
I hate to do EVERYTHING all over again, :face_with_symbols_over_mouth:

In the endā€¦ I managed to move my installation to Pi4.
I installed from scratch the Pi4 installing all the plugins and integration.
Then I copied only configuration and SSL.

Iā€™m migrating from an Intel NUC running Ubuntu 18.04 and Docker, I assume the process is the same?

1. Download the [Hass.io ](http://hass.io/) image for Rpi4
2. Image the new microSD card
3. Let the the Rpi4 boot and sit and download everything
4. Make a snapshot on the Rpi3 and download it
5. On the Rpi4 install Samba Share and copy the snapshot into the backup folder
6. Reboot the Rpi4
7. Restore the snapshot on the Rpi4
8. Shutdown the Rpi3 and change the Rpi4 to have the IP of the Rpi3

Hi there, I followed this instructions but for me it stucks at point 6. After reboot the copied snapshot is not shown in Snapshots (available snapshots). Anybody out there who can help?