user535562 asked:
So i have a nextcloud server in an EC2 instance, i have an EFS mounted to it but im not sure how to make nextcloud save the files on the EFS instead of EC2. Are there any guides or tutorials out there that shows you how to do such a thing?
Any help or ideas is greatly appreciated!
Thanks
My answer:
The general process is going to be to stop Nextcloud, move your files from your local instance storage to EFS, move the mount point, and then restart Nextcloud.
It will go something like this:
-
Mount EFS at a temporary directory.
sudo mkdir /mnt/efs sudo mount -t efs fs-12345678:/ /mnt/efs
-
Stop Nextcloud
Change to the Nextcloud installation directory, then:
sudo -u php php occ maintenance:mode --on
-
Move Nextcloud data files to EFS
sudo mv -v /nextcloud/datadirectory/.??* /nextcloud/datadirectory/.?? /mnt/efs
-
Verify the data directory is empty
sudo ls -al /nextcloud/datadirectory
-
Unmount EFS from temporary directory
sudo umount /mnt/efs
-
Mount EFS as the Nextcloud data directory
sudo mount -t efs fs-12345678:/ /nextcloud/datadirectory
-
Set up the permanent mountpoint in
/etc/fstab
fs-12345678:/ /nextcloud/datadirectory efs _netdev 0 0
-
Fix up ownership and permissions of the mountpoint and files if necessary
-
Restart Nextcloud
sudo -u php php occ maintenance:mode --off
You should change the usernames and directories shown above to match your own installation.
View the full question and any other answers on Server Fault.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.