Moving files to S3 storage
Create a bucket at AWS
- Select same region as server is hosted in
- Add bucket
- Select Directory if files are mainly media (pictures/video)
- Name the bucket: s3fs.CUSTOMER
Add IAM role to server
- Go to https://eu-north-1.console.aws.amazon.com/ec2/home
- Right click server > Security > Modify IAM role
- Choose ServerWithNetworkFilesystem
- Update IAM role
Install the mountpoint
- Install software: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mountpoint-installation.html
- Make a folder
sudo mkdir /mnt/s3fs
- Test the mount
sudo mount-s3 --allow-other --dir-mode 0777 --file-mode 0777 s3fs.CUSTOMER /mnt/s3fs
- Unmount again
sudo umount /mnt/s3fs
- Modify fstab for automatic mount
sudo nano /etc/fstab- Add a line add the end containing:
s3://s3fs.CUSTOMER/ /mnt/s3fs mount-s3 _netdev,nosuid,nodev,nofail,rw,allow-other,dir-mode=0777,file-mode=0777 0 0
- Try the fstab mount
sudo mount -a
- Option for multi instance server:
sudo mkdir /mnt/s3fs/<instancename>
Change storage location and policy
- Go to Server > Backend > Modules > Configuration
- Change filesystemStorageBasePath: /mnt/s3fs
- Option for multi instance server: /mnt/s3fs/<instancename>
- Change filesystemStorageActive: true
Migrate existing files til S3
- Call server URL
- Manual: main?command=dk.tempusserva.codeunit.system.PageConvertBlobsToFiles
- Full auto: main?command=dk.tempusserva.codeunit.system.PageConvertBlobsToFiles&convert