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

good morning Soyo,
I finally got the time to work on it. It took me the entire day as the process seems easy but at the end, due most probably to not having all the needed information, I made it with (so far) 3 issues.
The Issues:
1) My android App that was synching my photos as soon as one is made, does not manage to upload the pictures anymore. (that fr me is abit critical, of course).
2) I have an error from the contact synchronization. but is seems to be related to only 1 contact. that probably I have recently modified.

I cannot get around any of them. search a lot but does not seems to be any issue similar to mine.

3) I also noticed that the NCP password for the NC panel (port 4443) has changed and cannot login with the old password. my old password contains special characters and I read that if I want to change the given password (the one from the activation) I have to pay attention NOT to put characters like ) } and I cannot remember what else.
Maybe that is the reason?!?:roll_eyes:
As a user (not nc panel), I can login as ncp and the same password.
The issue is only to the nc panel with the ncp password.
Any take in any of the above issue?
Reagrds,
Kattivius

I solved the contact issue partially… There was one contact giving a problem.
I can now sync the contacts.
But in the nextcloud, contacts, I keep having this message:
“This contact was broken and received a fix. Please review the content and click here to save it.”
when I click the up arrow, the message goes away for that specific contact.
The thing is … the message is for every and each contact!

Hi kattivius,
first: sorry for the late answer.
Concerning point 1 and 2 I cannot help you, because I don’t use it.
Point 3: You may login via ssh and login. Then type: sudo ncp-config
Then [Config]->[nc-admin] and you can see/change the admin password to login via panel.

Your second message 6 hours ago: As I wrote, I don’t use the contact sync … sorry, don’t have a solution for this issue.

Hope, you get a solution. And don’t forget to give feedback, if you got it.

Good luck!

soyo

Hi Soyo,
will give it a try on point 3. But from what I understood so far (maybe not correctly), looks like the ncp password cannot contain special characters. that would explain why my old password would not work anymore.
I just noticed some other stra ge things;
I assumed the migration was successful as basically I have all my users and so far all login work well.
however, I realized that some apps have not been taken over: nextcloud mail and nextcloud calendar.
so now, I start doubting if I can rely to this installation/migration.

I will post all the solutions and fixes along the way (if I manage to do so).
that can maybe also help others.

kattivius

turns out that the calendar App is there but was not automatically enabled.
any other category is now blank. no apps whats so ever…
Tomorrow I will reboot the server and see if this is fixed and I can choose apps again.
Good night
Kattivius

reboot did not help.
NONE of the apps, beside those installed already, are even visible.
When I click on any category, it is simply empty.

I am also narrowing down an other issue… looks like there is a problem with the webdav!
I am now unable to upload anything… I tried uploading a picture (drag n drop), got an error (the picture is 375kb):
Expected filesize of 384670 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
if I use the android app error: Upload failed bad request
In linux Ubuntu the backup duplicity gives error: webdav error http: bad request
I realized that at the moment, the cloud is not functioning very well.
Summary:
App category is empty
webdag giving bed request in all uploads
android app gives bad request error
and linux back up also gives a bad request error.
Cant remember where but among all test, I got a http bad request!
Any suggestion?
Kattivius

Hi @soyo , all is fixed now.
First of all, I want to thank you for the time you spent helping me out with the migration. Your steps did help A LOT and I could migrate all users and configuration.
Really… I appreciate it.

moreover…
Finally was a temp path issue… long story to explain.
however, I made a new post with specific issue.
But I researched on the forum and among a few posts, I got my needed solution.
In case you are interested, or other coming across my post and have same issue, follow this post and you will solve the problem with uploading…
https://help.nextcloud.com/t/sabre-dav-exception-badrequest-raspberry-pi-4b/69866

Hi kattivius,
thanks for your response. I’m happy I could give a little help to the solution of the problems.

And thank you for your hint concerning the tmp path.

Have a nice weekend.

soyo

you can activate SSH from ncp-web, don’t need to do the /boot file trick