[Help needed] Move HDD from Rpi4 to Rpi5

Hello,
i have installed Nextcloud 20.0 on an Raspberrypi 4, 2 years ago and it worked really nice.
The installation of Nextcloud i have done on the MicroSD Card, and i have used an external 1TB HDD for the Data.

Now i bought a new RaspberryPi 5, and installed again the latest Nextcloud on the RPI5 MicroSD Card. and for the Data, i wanted to take my “old” 1TB HDD and us it, as it has all files on it.

i have configured it the same, so mounted the HDD on exact the same path, so the config.php looks the same, i pluged in the HDD, but i cannot access the files.

Question:
what should i do, in order to get the HDD with the “old” data working on the new RPI5?

Thank you !

Hi flopyro,

I get what you’re trying to do but I not being a NC expert, I doubt the NC data files are 2plug and play" when migrating. I believe some kind of data metadata must be maintained in the database, hence why this is specified when NC is installed.
On the other hand, if it were an external connected such as SMB connection, then you’ll be good to go.
So I think you may need to go through data migration steps which I’ve seen somewhere. But for that you’ll need both NC instances to be up and running.

This is just my attempt to think through this. But I may be totally wrong.

yes, i saw the migration topics, but as far as i have understood, both NC instances had the HDD installed, here, only 1 has the HDD, the otherone is without it.

So … i hope you know what i’m trying explain here.

This is untested but worth a try:

  1. Set your nextcloud data directory to something
  2. Create all users (I assume this is a private instance so you don’t have that many)
  3. Shutdown nginx/apache (your webserver)
  4. Attach your old harddisk to the new host
  5. Change nextcloud data directory to your old harddisk. Make sure file permissions are set correctly (same user as on old host?)
  6. Start webserver
  7. run occ file scan

Beware: Calendar etc. (everything stored in DB) is not migrated doing above steps. Just the files in the home directory.

ok, i have managet to see the files in the directory, by doing this:

  • copyed the original Pi5 data folder to the external hdd and giving the right permissions.
  • wanted to “Upload” the “old” data files thru the normal Nextcloud interface, and now i’m receiving the error “Operation is blocked by access control”.
    I think that some permissions are stilll not se correctly.

I wil just reinstall now a fresh copy of Nextcloud, i have lost already too much time trying to find the error here…