How do I move 2TB of data from a local drive on another PC to Nextcloud?

Nextcloud version : Linuxserver.io version: 30.0.1-ls347
Operating system and version : Unraid 6.12.13

Hi everyone,

I could really use some guidance with transferring files from my Ubuntu PC to a Nextcloud instance running on another PC using Unraid. Here’s the setup:

  • A 2TB HDD mounted on an Ubuntu machine.
  • Need to transfer these files to a local Nextcloud instance.

So far, I’ve attempted two methods but ran into issues:

  1. Mounting the Nextcloud Share Folder** : When trying to mount the share and copy over files from my Ubuntu PC, I encountered a “permission denied” error.
  2. Dragging Files via Web Interface** : This method is extremely slow; it’s taking hours just to create empty folders and frequently hangs during the process.

I also explored the External Storage App in Nextcloud but didn’t find an NFS option. The SMB/CIFS options require a username and password, which I don’t have configured for this setup.

This is a Dropbox drive, and I’ve seen a Dropbox app, but I would like to avoid downloading 2TB of data on my metered home internet when the files are right in the same room on the same LAN.

Since my Linux knowledge is quite limited, could anyone suggest steps or alternative methods to get these files onto my Nextcloud instance? Any advice would be greatly appreciated!

Thank you!

I recently handled a similar issue and followed this approach, specifically for Nextcloud AIO.

Note: All steps are executed as root.

Part 1: Rsync

I used rsync to transfer data from my local Linux desktop to the Linux server running Nextcloud AIO. I synced the data into my user directory on the server at:

/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/my_username/files/temporary_upload_folder

Part 2: Setting Up Permissions for Nextcloud on the Server

On the server where Nextcloud is running, it’s essential to set the correct owner and group for files and directories to www-data, as this user manages the web server (e.g., Apache or NGINX).

Changing the owner and group to www-data (on the server):

First, switch to the root user:

su -

Then navigate to the directory where all uploaded files are located within Nextcloud:

cd /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/my_username/files/temporary_upload_folder

To ensure proper access for the web server:

chown -R www-data:www-data .
  • This command changes both the owner and group to www-data for all files and directories in the current folder. Make sure to adjust the permissions for the temporary_upload_folder.

Adjusting Permissions for Directories (on the server):

Set the appropriate permissions for directories, giving the web server full access for execution, reading, and writing.

find . -type d -exec chmod 750 {} \;
  • This command applies permissions to all directories recursively.

Adjusting Permissions for Files (on the server):

For files, it’s important to set permissions allowing the web server to read and write data, while restricting other users to read-only access.

find . -type f -exec chmod 640 {} \;
  • This command applies permissions to all files.

Part 3: Scanning Files on the Nextcloud Server

Finally, scan all files on the server with the following command as root:

sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data && sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all

Conclusion

  • The files and directories in Nextcloud should now be owned by www-data and have the correct permissions to allow the web server to function properly.
1 Like

You can use e.g. scp to copy to /path/to/nextcloud/data/username/files and then

sudo -u www-data php occ files:scan --all

Change command for Docker.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.