Moving from armhf (32bit) to arm64 (Pi 4)

Since 2021 all images for the Raspberry Pi on GitHub are arm64 bit images. If you have set up your NCP before late 2020 you quite likely still run a armhf (32 bit) image.


  • This wiki attempts to create a beginner-friendly ‘how-to’ to move from armhf to arm64.
  • You are most welcome to contribute, by commenting and editing this wiki.

Why would you want arm64?

  • whole NC development focuses on 64bit so your 32bit NCP limits you in many ways and will do so increasingly.

  • However, before doing this you might want to consider abandoning your microSD all together and move to a boot from USB solution. There is a documentation over here . If you follow it you will also run NCP with a 64 bit image. However, there are some minor drawbacks to it.

If you wish to keep using the SD card, follow the steps below.


Outline

Starting Position:

  • We are using a Raspberry Pi 4 (the pi 3b+ should also work but there are a number of issues holding you back, see this post
  • We have an armhf (32bit) NCP instance set-up and want to keep its data without having to recover everything of it from a backup.
  • All data (datadir) is on an external storage device (i.e. USB stick, USB Drive…)
  • The Pi boots from the microSD
  • We assume that the pi is set up headless, so we use ssh.

What we will do:

Install a new arm64 image on the SD card
Recover ncp settings, users and apps
Connect the new arm64 ncp instance back to the previously used data drive (no need to restore full backup)


Moving from armhf (32bit) to arm64


Preparation

  1. Create a complete backup of your Nextcloud, to a separate drive (in case something goes wrong.)

  2. Navigate to Export-NCP to create a backup for your NCP configurations. This is the backup we will want to use to restore the ncp configurations. Save it to: /media/YOUR-BACKUP-DRIVE/ It will be called ncp-config_XXXXXXXX.tar

  3. Navigate to nc-backup to create a dataless backup. This backup we will want to use to restore users and apps. Save it to: /media/YOUR-BACKUP-DRIVE/ It will be called nextcloud_bkp_XXXXXXXX.tar

Installation

  1. Download the latest NextcloudPi_RPi_XX-XX-XX.tar.bz2.

  2. Unpack the .tar.bz2 file to get the .img

  3. Flash it to your SD card

  4. Power off your Raspberry Pi

  5. Remove the SD card with the 32bit image

  6. Important: Disconnect any of your attached data drives!

  7. Insert the new SD card with the arm64 image you just flashed

  8. Connect the pi to power to boot.

  9. Wait a few minutes and then access your Nextcloud by navigating to https://nextcloudpi.local in your browser. )If this fails log into your router to see what the IP address is given to your Pi. As the MAC Address is still the same, and you probably have set up a static IP with your router, it should still have the same IP as before.)

  10. You should now see the NCP Activation page.

  11. As you did when you set up your NCP the first time, note the two passwords (or use the Print button to make a .pdf of the page)

  12. Hit Activate

  13. After some time you should see the setup Wizard. Navigate to USB Configuration.
    (THIS STEP MIGHT NOT BE NECESSARY - PLEASE FEEDBACK)

    1. Do you want to save Nextcloud data in a USB drive?
      Klick YES

    2. Plug in your USB Data Drive you used previously.
      Do not format your USB drive! That’s the point of it all, we want to avoid having to restore the full data backup.

    3. Klick: skip (do not move data to USB, it might mess up things)

    4. Exit the Wizard.


Restore NCP Configurations

  1. Enter the web interface (admin panel) (https://nextcloudpi.local:4443) (or use the terminalncp-config if you prefer).

  2. Activate SSH

  3. On the left in section System choose nc-automount and activate it.

  4. Plug in your Bakup Drive

  5. Login to your pi via SSH (ssh pi@IP-ADDRESS)

  6. update the pi with sudo apt update & sudo apt upgrade

  7. update ncp (if there is an update) by typing sudo ncp-config and confirm.

  8. Type df -h to list attached drives.

  9. You should see your formerly used data drive and your backup drive

  10. Look for the name of your backup drive and type: ls /media/BACKUP-DRIVE/

  11. You should see a list of your backups.

  12. Look for the config-backup and note its name: ncp-config_XXXXXXXX.tar

  1. Go back to the NextcloudPi web pannel (at nextcloudpi.local)
  2. On the left in the section Backups choose nc-import-ncp
  3. Fill in path & file name and hit apply.
  4. This will not take long as it only restores your ncp settings. (You will not have any user or apps restored. This we will do in the following step.)

Restore Apps and User

  1. Follow step 5-9 from the description above.
  2. Look for the dataless backup file and note its name: nextcloud-bkp_XXXXXXXX_XXXXXXXXXX.tar (if you do not know which one is the data less backup, type: ls -l /media/BACKUP-DRIVE/ the -l will let a extended list appear which shows you the size of the file. This way you should be able to see which one is smaller and therefore the dataless only)
  3. Go back to the NextcloudPi web pannel (at nextcloudpi.local)
  4. On the left in the section Backups choose nc-restore
  5. Fill in path & file name and hit apply.
  6. As we only restore users and apps but not their data, this should not take very long.

nc-restore

  1. Once the backup has been restored successfully, reboot NCP using the web panel (top right) or reboot with SSH sudo reboot now
  2. Now you should be able to login with your former login, all your apps and users should be restored and the data on your USB media should be there as well.

Note:

  • The web panel login will not be restored. you will have to use the password you got when you first activated (NCP activation page)

I have tested this myself and succeded. See post 23.

I would appreciate if you can give a brief feedback if you succeed or have issues. It helps to improve this wiki. Thanks!

If you fail, you can follow this doc to restore the full backup.

3 Likes

The 64-bit image is available and runs great. I’ll offer assistance if you want it. What model Pi do you own?

I’ve been writing up this documentation for being stuck on armhf. Your basic plan looks good.

Thanks!

I have a Pi 4 4GB - so it should work well.

I assume you are talking about this arm64 image: https://downloads.raspberrypi.org/raspios_arm64/images/

There should soon be a arm64 NCP image for testing. I plan to use that one - to test it and to create the step-by-step guide.

However… I’m currently moving from Asia back to Europe, so it might not happen as fast as I would like…

There is an arm64 NCP image for testing here:

I just downloaded it and will test tomorrow.

Thanks for sharing the link. I didn’t test it yet but judging from the feedback in the Telegram group it seems to work.

I’m very busy now, but I hope to put together a first draft for a guide within two weeks.
I’ll post it here for review.

btw. how can I turn a post into a WIKI so others could edit the guide?

I tested the 64-bit NCP image and it boots, it works. I’m now in the process of migrating my exisiting NextcloudPi environment.

System: Host: nextcloudpi Kernel: 5.4.79-v8+ aarch64 bits: 64 compiler: gcc v: 8.4.0 Console: tty 0
Distro: Debian GNU/Linux 10 (buster)
Machine: Type: ARM Device System: Raspberry Pi 4 Model B Rev 1.1 details: BCM2835 rev: c03111

1 Like

Thanks for contrubuting

Unpacking results not in an .iso but an .img file

On Linux, I use dd to create the sd with (example):

dd /path/to/NextCloudPi_RPi_11-27-20.img of=/dev/mmcblk0 conv=sync,noerror bs=8M

replace /dev/mmcblk0 with the location/name of your sd card

Thanks for pointing that out, very embarrassing… I changed it.


Do you think the rest is ok and will work?
I’m really not sure about the restoring, will it work to reconnect the datadirthe way I describe it?

Not sure which “way” you are referring to?

nc-restore works for me, as described in documentation

nc-restore will launch nc-scan automatically, when there is no datatdir inside the restored NC directory. It will look for the datadir value in the restored /var/www/nextcloud/config/config.php and scan the files and update the database.

What I usually do, is create the mountpoint in the new system at the same location, so no manual edit of config is needed. If this is not possible, manually edit the location and run nc-scan after.

If it works for you and a few others, that is enough verification for me :wink:

I have no way to verify if moving from 32 to 64 bits will affect any of above, as I do not have a 64 bits SBC arm device. My rpi is a 2B+ so it is stuck to 32bits. (I use a NUCi5 and a HPz230i7 for my production NC, the 2B+ works but is to slow for my daily usage)

1 Like

would you guys mind, if i’d move this to the Howto-category and make the starting post a Wiki?

1 Like

Thank you @JimmyKater, Very good, but think you might want post (nr 7) as the starting point, if possible, the one with the actual steps. The 1st post being only the outline for them. But once a wiki, easy to edit and fill in any gaps. Thanks @michuvon

@OliverV - moved and made a wiki.

afaik I can’t change the rundown of the answers within a thread… but well… as it’s editable now, you might wanna do the rest :wink:

ah , I see, then can you make the post in question into a wiki? (Not the first one)
so others can contribute. I’ve no personal interest (or time) in rewriting it at the moment.

blond me… did that as well… :slight_smile:

1 Like

would you guys mind, if i’d move this to the Howto-category and make the starting post a Wiki?

great, thanks, that’s what I was going to ask for.

you might wanna do the rest

What do you mean? Rewrite the first post? Or start a whole new thread?

@michuvon I mean… Everyone can edit post 1 and the other one now… As they are Wikis

well, I think it’s better for the overview to have all in post 1.
I just merged post 1 & 7 into one.

So it will be enough if only that one is a wiki. - thanks.


1 Like

Sorry, I’m not sure what you mean with mountpoint.
What is exactly meant by that and at waht point do I need to set it up?

Do you mean that I need to name the USB drive the same as before?

(sorry might be a dumb question, but as mentioned before, sometimes basic knowledge is missing… hehe…

Mountpoint example: /media/mydrive

sudo mkdir /media/mydrive
sudo mount /dev/sda1 /media/mydrive

Where ncdata will be in /media/mydrive/ncdata

1 Like

Not yet 100% sure if I connect the dots correctly.

Do you mean that I can simply:

  • attatch the ‘old’ datadir drive
  • login with ssh
  • create a mountpoint
  • run nc-scan
  • load the configs using nc-import
  • done?

No need for nc-restore of the bkp needed?