How to restore data from a crashed Raspberry Pi Nextcloud?

I had a Raspberry Pi running a Nextcloud server on my home network, with the data folder stored unencrypted on a USB hard drive.

That Pi got damaged and no longer works, but I still have the intact hard drive with all the data in it. Now I would like to setup a new Raspberry Pi with a Nextcloud server and use the data folder in my hard drive.

Can I do that? Would it be as simple as migrating the data folder to point to the folder on the hard drive and running some command to re-read the files?

Thank you for your help!

1 Like

Hello mate, hope you are doing well…

That’s actually easy to do, one thing to keep in mind is to use the same usernames as before.

If you open your /nextcloud-data/files you will see that there are some folders named with the usernames used to log in.

When you deploy a new nextcloud server, just specify that path and it will work.

Just make sure that the right permissions are set.

All the best, good luck.

Thanks a lot!
Will Nextcloud automatically scan for the files when moving the data folder or do I have to run a occ command?

Yes there is one. occ scan or similar

You should run:

sudo -u apache php /path/to/your/nextcloud/occ files:scan --all

Hope it helps :smiley:

1 Like