Save NextCloud files to EFS

Hello peeps,

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

you simply mount the efs share to the nextcloud datadirectory. you’ll find a howto at the aws efs webpage.

best is to do this before you install nextcloud. because during installation some files and directories are create. if you do it after you have to move this file.
(stop nextcloud, rename data directory, mount efs, move file from ebs to efs)

i see, quick question though, don’t i have to also re-configure the config.php file in nextcloud to read/write data to the efs directory instead of the nextcloud/data directory?

i would mount the efs share to the nextcloud/data directory.

if you mount it to another location you have to move the files an directories and change 'datadirectory' => '/efs-mount', in the config.php.

If you set it in config.php, it will be globally configured for all users - all external shares will be mounted under /efs-mount for all users.
If you create external share for user, you can mount it under any existing folder in settings of external shares.

ok so if i mount the efs instance to the nextcloud/data directory any files that are saved from now on will be saved on the efs instance instead of EC2 which is where nextcloud sitting at?

yes.

but don’t forget to migrate all the files that exist on the ebs volume.

may i ask why you want to store your file on the efs share?

Sorry, I mist up this config parameter with a 'share_folder' => '/',. Please check this tread before to move your data folder location: HowTo: Change / Move data directory after installation