Raspberry pi 4B

Greetings,
I am looking in many posts to find the best way to upgrade my NC17 installation on a Raspberry Pi 3B+ and move it to Raspberry Pi 4B (4GB).
I did find several suggestion… one seemed to be the most possible one:
https://ownyourbits.com/2019/08/05/nextcloudpi-gets-a-backup-ui-moves-to-nc16-0-3-buster-php7-3-and-more/

So I follow it; did the update and the distribution upgrade.
I am now in Buster.
by cloud on the RPi3B+ works fine.
Up to the description, it is now only a matter of switching the sdcard to the RPi 4B and should work.
HOWEVER…
when I do that, the pi simply dont boot at all.
I checked as well by adding the hdmi and looking at the screen …
simply no signal at all.
(In case you wonder, I than burned a busted image to see if the Pi had a hardware failure, but it does not. buster starts well).
I would appreciate help in this … I dont know what else to try.
The sd card works. I put that back on the Pi 3 and my nextcloud is up and running again.
Info:
NC version: 17.0.2
Thanks

Hi kattivius,
upgrade to buster on RPI 3B and switch the sdcard to the 4B don’t work. The RPI 4 will not boot.
So I searched for solutions, like you did. Nothing found …

I had the Raspi 3B with Nextcloudpi installed on sdcard. Data, database and all backups stored on USB-drive (BTRFS formatted via ncp-config).

Because I had only one sdcard at that time, first I cloned the sdcard via dd into an imagefile to my home folder to be on the secure side.
Then I backed up all (config, database, apps) with the ncp-config tool, only the data I didn’t include.

Download a fresh image from ownyourbits.com and tranfer it via Etcher or in terminal with dd under linux to your new sdcard.
Create a text file named ‘ssh’ on the boot partition access raspi 4 via ssh.
Copy the config.php into the config-folder and move the new sdcard into the raspi 4 and start it.

Then restore the backups via ssh with the ncp-config tool.
After restoring all you have to create a new letsencrypt cerificate, activate fail2ban etc.

I hope I kept all in mind …

Good luck
soyo

Thanks Soyo.
Well… I than tried your same path.
the Etcher image worked well.
Of course, I added the ssh file too.
I repeated this operation about 3 times as I had always a different problem.
To be able to see whats going on, I still attached the HDMI to my TV to see what possible errors would come up.
I had all sort of issues… (I did not take not, sorry).
At first, I had some sort of automatic update… that got stock but I could SSH in the Pi. usless as I could not over come the issue.
After repeating the imaging of the SD (this stime I spent half hour prior to this to check for possible sd card problems using h2testw. turned out I have no issues with it! good)
Now I have different errors, different updates that actually hang and never finished (I waited for over 2h).
If I try the web UI, I have a screen that mention my nextcloud is not yet activate. and a password to copy (the screen is divided in 2 and each part say the same with a different password).
I click activate but it responds me that the configuration process is not yet finished… but it never does!
So, I am a little bit confused…
I wonder if I should install Buster and manually nextcloud… maybe on dockers???
I really would love to make use of my rpi4b with 4gb. I think is a fantastic improvement for nextcloud… but has to work!
My card is 32GB. as I read… is pretty much the max allowed GB size not to have other issues.
16GB should be best but I dont have it!
I will try again and again. and I will keep researching… I hope I will succeed.
Thanks for your feedback Soyo

Hi kattivius,
your configuration is: RaspberryPi 4B 4GB with 32 GB sdcard?
And Buster + nextcludpi + data + database is installed on this sdcard (original RPI 3B), right?
Awaiting your response.

… BTW: 32 GB sdcard here is no problem with RPI 4B - also 4 GB …

soyo

no, of course not!
data + DB is in an external 1T HHD.
And yes, I realized the 16GB limit suggestion was before RPi3.
The only think is that is a bit of a wasted space to use a large SDCARD as I only needed for Booting and OS and DB…
I have some really good A1 and A2 sdcard of 64GB… but… what for so large??
Also sdcards are more prone to corruption when too many IO
BTW
I think I find out that the SDcard I was using for testing NCP was corrupted.
I tested a A1 sdcard and had NCP running.
So, I think I will buy a 16GB A1 class 10 sandisk and try the restoring of the backup I have on the rp3.

Hi kattivius,
it’s weekend, and I “did it again”:wink:

These are my steps after cloning the raspberrypi image to the new sdcard via dd and making the backup via ncp-config.

  1. Delete the config.php in the new RPI4-sdcard.

  2. Copy ‘config.php’ from old RPI3-sdcard to RPI4-sdcard into the folder /var/www/nextcloud/config.

  3. Create a new 0-byte file named ‘ssh’ in the boot partition of the RPI4-sdcard.

  4. Push the new sdcard into the RPI4 and start it.

  5. Log in via ssh as user ‘pi’ and password ‘raspberry’.

  6. Your PC says: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

  7. Remove the old host key with 'ssh-keygen -f “/home/youraccount/.ssh/known_hosts” -R “xxx.xxx.xxx.xxx”

  8. Once more login as ‘pi’ and your PC says
    The authenticity of host ‘xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)’ can’t be established.
    ECDSA key fingerprint is SHA256:TSz/T8RZcTwbJcI38C/RM0iFYYhteezv1Uu03t0ChaM.
    Are you sure you want to continue connecting (yes/no)? yes

    NextCloudPi v1.19.1 is outdated
    update to v1.20.1 through ‘ncp-config’ or type ‘sudo ncp-update’

  9. SSH is enabled and the default password for the ‘pi’ user has not been changed.
    This is a security risk - please login as the ‘pi’ user and type ‘passwd’ to set a new password.

  10. pi@nextcloudpi:~ $ passwd
    Changing password for pi.
    Current password:
    New password:
    Retype new password:
    passwd: password updated successfully

  11. After ‘sudo ncp-config’ NextCloudPi is updating
    Downloading updates
    Performing updates
    Running nc-previews-auto
    Automatic preview generation enabled
    NextCloudPi updated to version v1.20.1

  12. ‘ncp-config’ -> ‘Restore’ … takes its time depending on the amount of users and activated apps.

  13. Open in the browser ‘https://xxx.xxx.xxx.xxx/activate

  14. Save or print the user names and corresponding passwords an ‘active’.

  15. Login as ‘ncp’ NextCloudPi user (NextCloudPi-Admin) via ‘https://nextcloudpi.local:4443’ and activate ‘letsencrypt’, ‘fail2ban’ and what you need/want.

It should run now.

Hope it will help.

soyo

Thanks Soyo, I hope you had a nice weekend.

As soon as my 16GB sdcard comes, I will finalize the installation.
In my test, I notices I could get in the nc configuration via gui directly.
Questions:

  1. why do you have to copy the config.php from rpi3?
    Cant you simply access the backup, restor it and have the configuration changed after reboot?

  2. on the same line of preview question:
    why the need of activate ‘letsencrypt’, ‘fail2ban’ and what you need/want manually again?
    does the restoring of NCP configuration would not activate it as before (provided was already activated in previews backup - that would be my case-)

Kattivius

Thanks kattivius,

weekend was fine, hope for you too…

First point:
My thought was to give the ncp-config the chance to take the right path to my backup folder on the usb drive.
There I store the data, database and backups by default, as I wrote.
So I only need to complete the numbers of the backup filename to restore the database primarily.

May be, it is not necessary but I did it this way.

Second point:
Letsencrypt with all his parameters and keys is not stored in the backup, as far as I know.
You have to go through the procedure once more on the RPI4.

The activation and settings of fail2ban have both default status: not activated, settings default.
At least you have to activate fail2ban.

To be on the same level as before you should list all activated security settings, apps etc. on the RPI3 in the admin website to match the settings on the RPI4.
That was my way.

Hope it helps.
soyo

Hi Soyo,
got it!
as soon as I will receive my sdcard and do the installation, I will restore back up. and anything that is not restored as you pointed out, I will do it manually.
Appreciate your raising flags upon those configurations. Are very important.
Kattivius

Hi kattivius,
let me know, if something don’t work. Hope it works for you.
Appreciate your feedback.
soyo