Unable to import 200+ GB of Photos and Videos

Hi all,

I hope you guys are able to help, i have now tried multiple ways but I can’t import my photos to Nextcloud. I failed using the GUI (External Storage and Drag&Drop) so I tried it via the terminal:

After mounting my Synology shared folder via NFS I transfer my media using rsync:

rsync -ahP --info=progress2 --no-perms --exclude='@*/' /mnt/synology_photos/ /var/www/nextcloud-data/user/files/Photos

There is no issue with the transfer. After unmounting the drive I update the DB:

su -s /bin/bash www-data -c 'php -d memory_limit=4G occ files:scan --all'

After a reboot I’m able to see the photos with my user account, BUT I can’t delete any files. I get the error “Failed to delete Frog.jpg”, so it seems that there is something wrong with my files/db. I’m able to delete files with other accounts though.

My set-up:

  • Nextcloud 27.1.1 on Proxmox VM
  • 400GB HD, 8GB Ram

Thanks for your help!

A new install and using the maintenance mode for data transfer and setting the permissions did the trick:

su www-data -s /bin/bash -c "php /var/www/nextcloud/occ maintenance:mode --on"
rsync -ahP --info=progress2 --no-perms --exclude='@*/' /mnt/synology_photos/ /var/www/nextcloud-data/USER/files/Photos
chown -R www-data:www-data /var/www/nextcloud-data/USER/files/
chmod -R 750 /var/www/nextcloud-data/USER/files/
su www-data -s /bin/bash -c "php /var/www/nextcloud/occ maintenance:mode --off"
su www-data -s /bin/bash -c "php -d memory_limit=4G /var/www/nextcloud/occ files:scan --all"