SOLVED
I basically followed the directions of these two links, except since the VM runs postgrel I skipped the database part and just did an occ files:scan
Basic steps taken:
-
I have been doing an rysnc backup to a second array that is hooked to the vm as a shared folder. When I do that I put Nextcloud in maintenance mode.
-
Shutdown the vm, make another vdi of the correct size. I like to then boot these up on a simple vm with gparted installed, it could also be done with a live boot CD. I boot up and use gparted to make a partition of the whole array as ext4. Shutdown.
-
Connect this drive to the cloud vm. Boot up, go into maintenance mode, rsync backup the files to the other array (or external HDD) you really don’t want your backup to be on the same disk/array if it’s large. Since I had previous backups mine went quick.
-
Mount the new vdi you formatted in step two. rsync the data from your backup to it, INCLUDE hidden files or you will miss .ocdata and .htaccess in the root. Mine took about an hour and a half to move 1TB.
-
sudo chown -R www-data:www-data /new/path/to/data
-
nano /path/to/nextcloud/config/config.php
‘datadirectory’ => ‘/new/path/to/data’, -
turn maintenance mode off : sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --off
-
This is where I had to skip the db process in link one and use occ files:scan from link two sudo -u www-data php console.php files:scan --all
-
Let that run, I only had two users setup so mine didn’t take long. Plus most of my files are large videos.
-
Reboot and check everything. So far mine is working fine. I’ll update the thread if I see anything weird pop up.