Nextcloud TrueNas Moving Files and Reinstall

Joined
Dec 16, 2020
Messages
5
Good Morning!
I am new to True/FreeNas and as I am learning I came across an issue. I am guessing this will be an easy fix but not sure where to start. My friend set me up with TrueNas, which converted me from FreeNas. We also did a fresh install of Nextcloud, but before we did he had me move all my files (via copy) to another location. We deleted the old NextCloud instance and once reinstalled I copied all my files back to the new directory. This took awhile and completed overnight. However now I cannot access my files at all. From reading it looks like I will need to rebuild my index or database. I have tried something with sudo, however that command is not recognized within the jail shell command.

I can see the files if I do an ls command at the following directories (2 users):
/usr/local/www/nextcloud/data/Mattingly/files
/usr/local/www/nextcloud/data/Jeter/files

When I go into the NextCloud UI I am able to add folders which show up within these directories, but I can't seem to have it refresh itself to show all my old files.

I appreciate any help and guidance, True and Free Nas have been fun to learn so far.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
If you've copied files around you may have some permission issues to resolve. I think they need to be www:www.

I'd have a read through some of the forum Owncloud/Nextcloud threads which probably describe a best-practice of keeping the database and files outside the jail running Nextcloud. It keeps this much easier when it comes to backing up and updating.

Good luck!
 
Joined
Dec 16, 2020
Messages
5
Yeah that does seem to be the case. I am trying the su -m www -c php occ files:scan. However I had this running over night and it looks like its still running. So I am hoping this can be the fix.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
What are the permissions on the files using ls -l

You can change them easily enough with chown -R www:www <folder> - from what I can see on my files folder, everything had permissions of www:www
 
Joined
Dec 16, 2020
Messages
5
What are the permissions on the files using ls -l

You can change them easily enough with chown -R www:www <folder> - from what I can see on my files folder, everything had permissions of www:www

Looks like they are both www:
drwxr-xr-x 19 www www
drwxr-xr-x 7 www www

The scan I am running is still going too, so that makes me wonder if anything is really happening at all.

I am wondering if I just need to delete all the files again and then upload them a certain way so that the UI reconigizes the files associated. (But this is not something I am sure how to do either)
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
If all the files inside those folders have the same permissions then I'm not sure what else to suggest. I've never run the file:scan command so not sure how long it should or shouldn't take.
 
Joined
Dec 16, 2020
Messages
5
If all the files inside those folders have the same permissions then I'm not sure what else to suggest. I've never run the file:scan command so not sure how long it should or shouldn't take.

Thanks @adrianwi NextCloud has been really frustrating to deal with moving this data.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
- You don't need to move files to reinstall Nextcloud, if you delete everything except userdata it reinstalls
- Why reinstall? Updates of nextcloud might become a bit buggy at times, but a full reinstall is often not needed.
- If you want to make sure your data doesn't get corrupted, you can just snapshot the dataset containing Nextcloud or just the datasets containing the nextcloud userdata, config and/ór DB.

It sounds like your friend set you up for all sorts of issue and left you to figure out why his ways failed.

From your post it's also not clear what folder mounts are made and how you and your friend installed Nextcloud.
It might just be a permissions issue... so just try some different CHMOD and CHOWN issues (basically put them the same as the rest of the nextcloud config)
 
Joined
Dec 16, 2020
Messages
5
- You don't need to move files to reinstall Nextcloud, if you delete everything except userdata it reinstalls
- Why reinstall? Updates of nextcloud might become a bit buggy at times, but a full reinstall is often not needed.
- If you want to make sure your data doesn't get corrupted, you can just snapshot the dataset containing Nextcloud or just the datasets containing the nextcloud userdata, config and/ór DB.

It sounds like your friend set you up for all sorts of issue and left you to figure out why his ways failed.

From your post it's also not clear what folder mounts are made and how you and your friend installed Nextcloud.
It might just be a permissions issue... so just try some different CHMOD and CHOWN issues (basically put them the same as the rest of the nextcloud config)

Thanks @ornias the big reason that we went the route of reinstall is for some reason my gateway couldn't recognize the IP of my server. We had issues trying to re-establish the link so we thought the fresh install would help.

This has been an interesting learning experience so far for sure. I am just not understanding why a file scan isn't correcting the problem. The file scan was left to run for 48 hours and nothing seemed to come of it. I will play around with the file permissions some more to see if that might be the culprit.

If all else fails I may just try to move all the data using the WebDav to see if that will correct the problem.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
If your permissions aren't right there is nothing for the filescan to read ;-)
 
Top