Upload a folder from host machine to Nextcloud

Hi what is the best way to upload a folder to nextcloud via command line when this folder is already on the machine that hosts the nextcloud webserver? I cannot simply move it to the nextcloud data-folder right?

Why shouldn’t that possible? You only have to make sure that you change the ownership of the folders/files so that they are owned be the files:web server user and that you use the “./occ files:scan ...” command to update the file information in the Nextcloud database.

1 Like

if you have ssh-access and rsync is installed on the nc-server:
very basic: rsync -a DIR/ nc-server:/path/to/DIR
just syncs the contents of DIR to DIR in the path of nc-server/DIR w/the help of ssh
check out the manpage of rsync, you probably need to adjust some params and might be able to do it with smarter options and less commands.
after that, adjust ownership/perms of the new files on the server and run occ files:scan ... as mentioned above by @j-ed
GOOD LUCK!

1 Like

ah yes that works perfectly, I was missing the occ command :slight_smile: Thanks a lot!