Recently I acquired a Raspberry Pi 4 with 8GB of RAM, bigger from the RPi 4 with 4GB where I have my Nextcloud. The reason is that I intend to install the LibreOffice apps (that I've read that consumes RAM) and I'd like to have also an Akkoma instance running in the same machine. I was wondering if it'd be as simple as swapping the SD Cards, so just tried it 🚀
Yes, it's as simple as swapping the SD Cards between Raspberries.
First I did a quick search in internet to end up in an old-ish entry in the Raspberry Pi official forum where they explain that all new Raspbian images are compatible with the previous ones. In my case is even easier, as I move from a Raspberry Pi 4 to another Raspberry Pi 4.
Then, due to my extensive knowledge on Nextcloud and Docker, I searched for the steps to bring down both: for Nextcloud there is no such a stop
button, but it's recommended to enter into maintenance mode so that client apps get notified and the system gets clean, and for the Docker, well, I got to know the stop
command.
Then I simply executed the swap and started the new Raspberry over, removed the maintenance mode and volià .
Yeah, I knew it. There we go. I'm starting from the installation setup done in the previous Nextcloud article.
SSh into the Raspberry
ssh xavier@tatooine
Enter into Maintenance mode
occ maintenance:mode --on
Wait some minutes, to let some time to the clients to receive the maintenance signal
Stop reverse-proxy container
cd ~/reverse-proxy/
docker stop stop
Stop Nextcloud containers (App and database)
cd ~/nextcloud/
docker compose stop
Stop the Raspberry Pi itself
sudo shutdown -h now
Disconnect the power cable from the origin Raspberry Pi
Remove the SD Card from the origin Raspberry Pi and insert it into the target Raspberry Pi
Disconnect the USBs from the origin Raspberry Pi and connect them into the target Raspberry Pi
Make sure that the target Raspberry Pi has the ethernet cable connected (and the cable connected to the network!)
Connect the power cable in the target Raspberry Pi. If we have the HDMI cable connected we’ll see the Raspberry Pi starting and we’ll see that the docker containers are actually starting too!
When the Raspberry finishes starting, ssh into it and check that the containers are running
docker ps
Exit from the maintenance mode
occ maintenance:mode --off
Navigate to the domain that points to the Nextcloud instance and see the beautiful Dashboard waving us!
Extra ball, this is the htop
output!
So for one time, the whole process was way easier than expected. To be honest, I expected quite some complications, like issues recognizing the hardware, or problems regarding hardware IDs hardcoded in the system, or the Docker installation refusing to start after the swap, but no, everything was smooth and easy.