How to Manually add files to OwnCloud / NextCloud database


Norrox

Recommended Posts

You move the files to your user/files folder in your owncloud data folder.

then you run this command in the unraid terminal window.

docker exec -u www-data name_of_your_owncloud_docker php occ files:scan --all

then it should scan for all the files you moved to owncloud and add them to the database.

much faster than if you had to download the files from another software and then try to sync them to owncloud, can be buggy and take long when there are alot of small files.

Hope this help someone, took me ages to figure it out since i'm new to this kind of stuff :)

 

Edit: for nextcloud

docker exec -it nextcloud_container_name occ list

 

Edited by Norrox
  • Thanks 2
Link to comment
  • 7 months later...

You can also have ownCloud scan for manually added files in the background by setting the following in the confg.php file:

/**
 * Define how often filesystem changes are detected
 * Specifies how often the local filesystem (the ownCloud data/ directory, and
 * NFS mounts in data/) is checked for changes made outside ownCloud. This
 * does not apply to external storages.
 *
 * 0 -> Never check the filesystem for outside changes, provides a performance
 * increase when it's certain that no changes are made directly to the
 * filesystem
 *
 * 1 -> Check each file or folder at most once per request, recommended for
 * general use if outside changes might happen.
 */
'filesystem_check_changes' => 0,

 

  • Like 1
Link to comment
  • 4 weeks later...
On 1/14/2020 at 4:21 PM, Norrox said:

You move the files to your user/files folder in your owncloud data folder.

then you run this command in the unraid terminal window.


docker exec -u www-data name_of_your_owncloud_docker php occ files:scan --all

then it should scan for all the files you moved to owncloud and add them to the database.

much faster than if you had to download the files from another software and then try to sync them to owncloud, can be buggy and take long when there are alot of small files.

Hope this help someone, took me ages to figure it out since i'm new to this kind of stuff :)

Can you please provide similar commands for nextcloud? 

  • Like 1
Link to comment
  • 2 weeks later...
  • 11 months later...
On 8/15/2020 at 1:51 PM, dlandon said:

You can also have ownCloud scan for manually added files in the background by setting the following in the confg.php file:

/**
 * Define how often filesystem changes are detected
 * Specifies how often the local filesystem (the ownCloud data/ directory, and
 * NFS mounts in data/) is checked for changes made outside ownCloud. This
 * does not apply to external storages.
 *
 * 0 -> Never check the filesystem for outside changes, provides a performance
 * increase when it's certain that no changes are made directly to the
 * filesystem
 *
 * 1 -> Check each file or folder at most once per request, recommended for
 * general use if outside changes might happen.
 */
'filesystem_check_changes' => 0,

 

maybe an old topic. but I used this, and it scans properly, the folders are just of a different ownership. But Icant get the occ working if I go to my owncloud console, to my /config/www/owncloud and then use php occ. 
Maybe you know a quick answer, I cant seem to find out what Im doing wrong here.

 

maybe my user is not www-data? edit: it's abc. thanks.

Edited by Kees Fluitman
Link to comment
12 minutes ago, Kees Fluitman said:

maybe an old topic. but I used this, and it scans properly, the folders are just of a different ownership. But Icant get the occ working if I go to my owncloud console, to my /config/www/owncloud and then use php occ. 
Maybe you know a quick answer, I cant seem to find out what Im doing wrong here.

 

maybe my user is not www-data?

Be sure it has execute permission: 'chmod +x occ'.  To execute it: 'sudo -u abc ./occ'.

Link to comment
  • 1 year later...

I'm also curious about this. I'm moving my nextcloud install to a new server (Nextcloud Hub 7 (28.0.1) ). I'm also changing the database connection over from mariadb/mysql to postgresql15. I decided not to bother with the database migration, and am just going to rebuild. I have three users: admin, ruth, and ann. I figured I'd create the users, then point the entire storage directory over at my /mnt/user/nextcloud share. Not sure what the hell will happen with permissions there - I need the ruth files to be there for ruth, ann files for ann, etc.

<throws hands in air> Let's mess around and find out!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.