Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

Nextcloud Move Data Directory

20170918 If Nextcloud is having trouble uploading my photos or files in general, check if the Nextcloud server's disk is full. Typically an installation is located at /var/www/nextcloud. Note that the sum of the disk usage across all users might be much less than the actual reported utilisation of disk:

$ du -sh /var/www/nextcloud/data/*
36G   /var/www/nextcloud/data/
Nextcloud maintains backups and previous versions of documents.

If storage has become full then one option (apart from deleteing backups and versions as discussed in Section 59.6) is to move the another folder on another storage device.

Suppose another volume is available. First format it then mount it:

$ sudo mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 

$ sudo mkdir -p /mnt/volume-sgp1-01

$ sudo mount -o discard,defaults \
             /dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 \
             /mnt/volume-sgp1-01 

$ echo /dev/disk/by-id/scsi-0DO_Volume_volume-sgp1-01 \
       /mnt/volume-sgp1-01 ext4 defaults,nofail,discard 0 0 |
  sudo tee -a /etc/fstab

Now move the data to this new disk and create a symbolic link from the old location /var/www/nextcloud/data:

$ occ maintenance:mode --on
$ sudo rsync -vazh /var/www/nextcloud/data/ \
                   /mnt/volume-sgp1-01/nextcloud_data_backup_20170918/ 
$ sudo mv /var/www/nextcloud/data /mnt/volume-sgp1-01/nextcloud_data
$ sudo ln -s /mnt/volume-sgp1-01/nextcloud_data /var/www/nextcloud/data
$ occ maintenance:mode --off

Files might not be available through the GUI immediately. Try a reboot to get things working again. If Nextcloud comes up in singleuser mode so:

$ occ maintenance:singleuser --off

References


Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. Creative Commons ShareAlike V4.