Transfer Data from USB HDD from MacOS to nextcloud

Hello Community,

i have an RPI4 with 8GB RAM and an connected NVMe over USB3.0 with 1TB. On that RPI NextcloudPI is running.

Now i would like to transfer about 500GB of Data from an USB HDD which is connected to my Macbook over ssh to my nextcloud drive. I know that i cannot do it with scp cause the data owner on nextcloud is www-data.

So what is the easiest and best way to transfer my data from USB Drive on MAcOS to my NextcloudPI Drive?

Is there also a good tool so that i can check later on my nextcloudpi if i have duplicate images or files in any directory???

Would be cool to get some hints from you guys:-)

I have just tried this command from my MACbook. The 01_DOCS source folder is located o a USB HDD at /Volumes/HDDDRIVE/:
sudo scp -rp 01_DOCS/ ncp@

but when i hit this command i get the error “permission denied” this is cause the directory on the destination folder is owned by www-data. So i have to be root to do this. But i cannot ssh into nextcloud with root only as pi or as my user ncp.

it works now after i have activated the root account in /etc/ssh/sshd_config changed the “PermitRootLogin” to yes and restarted sshd with "/etc/init.d/ssh restart. After that i have set the password with sudo passwd root. After that i was able to execute the scp command above as root user.

After finishing the data transfer i will execute the scan command:
sudo -u www-data php occ files:scan --path=/User/files/my_groupfolder_path

Am I right or did i forgot something???