Moving files to Nexcloud folders


#1

I installed Nextcloud on my NAS (readyNAS 102) where I was using before owncloud.Once the accounts were created I accessed the NAS file system via SSH and copied the files to the nexcloud folders. However the files doesnt show up in the Nextcloud web, neither in the user mapped folder (via webdav)

i can see the files are in the user folder, they show up on ssh and in the NAS control panel. The files are alongside the default files that shown up in the browser.

what am i missing to make the files available for the users?


#2

Hi,

While Nextcloud is a web application, please don’t write files to the nextcloud data directory in any other way than via web access. Meaning, it doesn’t work to move or copy files there via SSH.

You can do two things right now:

  1. remove the files (that don’t show up in the web interface) via SSH from that folder again and upload these files via web browser
  2. run the occ command with “files:scan all” (sudo -u <user of webserver> php /path/to/nextcloud/occ files:scan all)

The second option will re-scan all files in the user’s data folder and update the database, so that these files should show up in the browser. Nonetheless as stated above, this is not the regular way and should be avoided :slight_smile:


#3

Thanks. I will try #2. The amount of files is actually very large, and for different users. it is really a pain to do it via web browser, it takes ages.

As i understand I have to do it for each user, right? is each nextcloud user, not the admin?
and the path/to/nextcloud/cc is to folder of that user, right?


#4

Alright, yes then step #2 is the first you should do. However, for later uploads, rather use the web browser or the Nextcloud apps :wink: (any other webdav client would work as well though).

If you run “occ files:scan all” it rescans all user folders. Only run this command and you are set.

/path/to/nextcloud is not the path to the user’s data folders, it is the path where nextcloud is installed. It might be /var/www/nextcloud for example. The nextcloud folder contains the folder config, apps, core, and so on.
occ is actually a program, a script within that nextcloud folder. So as explicit example:

sudo -u www-data php /var/www/nextcloud/occ files:scan all


#5

thank you! I will give it a try.

I actually tried moving the files with the windows browser after mapping the drive (webdav connection), but then I run out of “available” space in the drive, which is not true of course. The mapped drive was created with a limited space, according to my free space in my local HD.

Then I just did the moving with the windows browser but browsing the network folders.

Unfortunately I can not use the sync app because my local HD is too small. All the files are in the NAS so it was more about moving it from a NAS share to another.

I will post how it goes. Thanks


#6

Unfortunately the NAS system doesnt allow me to run “sudo” commands.

-bash: sudo: command not found
-bash: /apps/nextcloud/web/occ: Permission denied

I tried by suggestion of a Netgear community member this:

chown -R admin:admin /data/nextcloud/

and effectively a couple of folders were visible afterwards, but the most of files are still hidden.


#7

:frowning:
Don’t mess around too much. If something doesn’t work and you’re not sure what you are doing, rather ask back here - well unless you have a good backup :smiley: Then you can mess around as much as you want :wink:

Could you please provide more information about your system? I suggest using the Issue template (there is an app in the store), which automatically asks for the most important data.

Furthermore, please let us know which user is running the web server (www-data, http, …)?

As a second step…
Please revert back your changes, so that /data/nextcloud is again owned by the user which runs the web server.
Afterwards try the following and let us know the outcome:
/usr/local/bin/sudo -u www-data php /var/www/nextcloud/occ files:scan all
or
/usr/bin/sudo -u www-data php /var/www/nextcloud/occ files:scan all
(change user and path accordingly).


#8

well as im just populating the data then i can mess around I still have a backup from where i took all the data. and the NAS itself was recently factory reset. :slight_smile:

I will look for the app in the store, meanwhile, I try to answer your questions, Im not that knowledgeable in linux and webservers but I try my best.

when I check ls -al /data/nexcloud I get this: drwxrwxrwx+ 1 admin admin 90 May 14 20:00 osilvab It seems to me that the user is “admin”, “osilvab” as you can guess is the nextcloud username for that folder. This wasn’t change.

I have to check if the /usr/bin/sudo even exists, as I think the file system in the NAS is a bit different than the standard Linux distributions. even the nextcloud is not installed in /var/www but in /apps


#9

well. at the end i decided to transfer all the files again. it took a couple of days. but i didnt have to be in front anyway

I wonder why so slow when you you use the web app