Pi 2 / 3 / 3+ upgrade to 4 / 400

Hi there,

upgrading the Hardware from Raspberry Pi 2 to 3 or 3+ was easy because it was using the same Image (see also Pi2 to Pi3 Upgrade)

Because Raspberry Pi 4 has a different image as for Raspberry 2, 3 and 3+, I’m not sure if one can upgrade the hardware that simple (It even switches from 32-bit to 64-bit). Is there any place where I can have a look into the differences between the images? Is it possible (even with some effort) to upgrade without reinstalling?

What I have done so far:

  • Backup of the sd-card

What I am currently doing:

  • Waiting for the upgrade from v18.9 to v19.1 on a Raspberry 2

What I am planning to do:

  • another backup
  • enable multiarch for armhf+arm64
  • install rbp4-mediacenter-osmc and rbp464-kernel-osmc (and resolve dependencies and apt autoremove, etc)
  • extend /boot/config.txt with arm_64bit=1
  • shutdown
  • backup, you know
  • placing sd-card in Pi4, boot and be happy :slight_smile:

Am I missing something obvious? Do you think this will also work for updates in the future?

You should install OSMC from fresh on the Pi 4 using a Pi 4 image.

It worked :slight_smile: Here’s my little unclean history (the missing numbers have been debugging).

# make the system multiarch
  465  dpkg --add-architecture arm64
  466  apt update

# this command crashed, If you execute command 483 before this, fixing the broken dependencies may be easier
  480  apt install rbp4-device-osmc
# comment the line with the exit 1 inside this file (package should be marked as essential instead of doing this)
  483  nano /var/lib/dpkg/info/rbp2-device-osmc.prerm
# now the removal works
  490  apt remove rbp2-device-osmc
# try the installation again
  491  apt install rbp4-device-osmc
# there are some problems because the packages are not having correct Break: and Conflicts:
  492  apt remove rbp2-kernel-osmc
  493  dpkg --remove rbp2-kernel-osmc
  494  apt install -f
  495  dpkg --remove rbp2-ftr-osmc
  496  apt install -f
# remove old kernels, you can check your old kernels with apt list rbp2-image\*
  497  dpkg --remove rbp2-image-4.19.122-2-osmc 
  498  dpkg --remove rbp2-image-5.10.32-2-osmc
# now the new kernel (64-bit) is installed and old ones are removed. This means you cannot boot on rpi2 anymore, (I didn't try rpi3).
  499  systemctl poweroff

I forgot to set arm_64bit=1 in config.txt but switching the sd-card to the rpi4 worked anyway, so who cares ;). The only thing I had to do was to place the new MAC in my DHCP-Settings and reenable ipv6 (Enabling IPv6 in OSMC - #9 by ActionA)

I know, there are still tasks missing, like switching some applications from armhf to arm64 like apt and coreutils and stuff. I might also get problems when updates are coming in place but for now, I’m happy :wink: – and it was waaaaay less work then reinstalling because I’m running a lot of other applications on the device – that’s my reason for using osmc, it has debian :slight_smile:

You’ve bodged it a bit, so well done.

cat /proc/cmdline probably still shows osmcdev=rbp2. You should fix that up by editing cmdline.txt.

If it works and you don’t anticipate installing any updates, then great.

Otherwise, you should definitely reinstall, and consider using something like Ansible to automate your OSMC deployment and make things easier when re-imaging.