0

I have a RPi v3 that's been running very well for me for years now. It is mainly a file server, running SAMBA, NFS and AFP on Buster, along with some other random services. The DHCP setup is also a bit customized to deal with my home network setup. Because it is old, I'd like to move the 'server' to a RPi 4 board - i.e. I want to have a server of the same name and using the same ip address on my network running all the same services with the same configuration, have the same accounts, passwords and so on, but I want that server to be backed by a RPi board.

Is there a recommended way to take all of the installed packages, and their configurations, users, etc, and move them over to a fresh install of Buster on the RPi 4 board?

FWIW, I have tried simply moving the existing SD card to the new Pi board, but that seems to require re-partitioning the card, which I cannot figure out and does not seem the right way to go anyway, so I thought it better to do a clean install on the new board and get the existing packages and configuration set up.

  • 3
    "have tried simply moving the existing SD card to the new Pi board, but that seems to require re-partitioning the card" That should not be the case, but you will need kernel8.img in the boot partition -- if you've kept it updated it should already be there. An up-to-date, functional buster card should work in all models. If it doesn't you might want to try a more detailed question about what goes wrong. – goldilocks Mar 08 '21 at 19:03
  • The SD card that I'm dealing with has a very small (44M) boot partition, with the remainder of the 32G card containing the root file system. FWIW, the boot partition has kernel7.img, but not kernel8... My understanding is that the Pi 4 board needs a larger boot partition to boot. But unfortunately, I'm not able to see what is happening in the boot process, b/c I do not have a micro HDMI adapter (I'm looking to run this headless). Am I wrong about the boot partition sizing? – i_am_Halloran Mar 10 '21 at 14:57
  • 1
    I don't think it needs a larger boot partition, but on an up-to-date 32-bit RpiOS the actual volume is 48 MB, and includes kernel8.img (I did not put it there, although the original image was not long ago so it was included in that). However, the 64-bit version only contains 30MB. Re: "I do not have a micro HDMI adapter", it might be worth getting one for such troubleshooting, you stand to waste a lot of time without it. – goldilocks Mar 10 '21 at 15:24
  • FWIW, I have resolved the issue by doing a fresh install on the RPi 4, and configuring the services with the configurations from my /etc directory. Thanks to all for the suggestions. – i_am_Halloran Mar 11 '21 at 21:09

2 Answers2

0

I recently moved a pi2 installation to a pi4, the only difference being mine were running on USB HDDs. I used Raspibackup to do this as the target SSD was smaller than the source HDD, it all went very well. Your situation looks simpler so should be a breeze.

Bra1n
  • 1,251
  • 7
  • 7
0

As goldilocks said an up-to-date Buster card should work in all models, although it is possible (with some unusual settings) to make a model dependent OS.

There is no "recommended way to take all of the installed packages, and their configurations, users, etc, and move them over to a fresh install of Buster".
You may be interested in the following procedure I use.
This was originally written to move to Stretch and modified for Buster and recently used to setup Raspberry Pi OS(64bit).

This still is more of a personal checklist, and may not suit everyone, but could form a starting point.
It does not copy configurations; I had procedures to do this but it was more effort keeping them up to date than manual configuration.

To perform a fresh install on the Pi
2019-06-20-raspbian-buster.zip
Preparation
1. On working Pi backup home directory & ssh keys
    cd /home; sudo tar czf pi_home.tar.gz pi
    cd /; sudo tar czf /home/sshOrig.tar.gz etc/ssh
2. Prepare list of user installed apps to install on new Pi.
3. Backup Bluetooth
    sudo su
    tar cf bluePi4.tar /var/lib/bluetooth

  1. Install new image on SD Card.
  2. Mount boot partition, and touch ssh copy wpa_supplicant.conf
  3. Boot Pi and configure (prompt on screen including update); change password Set Locale en Au UTF-8 Set Timezone Sydney Set Keyboard US International Set WiFi Country AU turn off serial console & serial

Change your Appearance Settings Picture to /usr/share/raspberrypi-artwork/raspberry-pi-logo-small.png Menu Bar Medium (24x24)

4 ftp pi_home.tar.gz to /home and copy contents to new Pi cd /home; sudo tar -xzf pi_home.tar.gz l

Update .ssh/known_hosts on iMac

<!--
5 Restore ssh keys
    cd /; sudo tar -xf /home/sshOrig.tar.gz
 -->

6 Set hostname 7 Customise config.txt; NOTE changed config <!-- sudo ./setupConfig.sh --> <!-- 8 General tidy - delete .Wolfram etc not installed --> 8 Customise /etc/dhcpcd.conf slaac hwaddr #slaac private 9 Install Apps PiApps.sh filezilla netatalk gparted ssmtp mailutils watchdog apt-file 14 Customise fstab configSftab.sh 15 install nfs-kernel-server

10 Customise /etc/netatalk/afp.conf 2019-06-27 NOTE changed config

13 Restore Bluetooth 2019-06-28 sudo su cd / tar xf /home/pi/bluePi3.tar 15 install nfs-kernel-server

Edit /etc/logrotate.d/apt to keep 24 months

This assumes you know which apps you have installed. See https://raspberrypi.stackexchange.com/a/118890/8697

Milliways
  • 59,890
  • 31
  • 101
  • 209