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
- wget https://s3.amazonaws.com/mountpoint-s3-release/latest/x86_64/mount-s3.rpm
- sudo yum install ./mount-s3.rpm -y
- sudo nano /etc/fuse.conf
- remove # before user_allow_other
- save file
- sudo mkdir /mnt/s3fs
- sudo mount-s3 --allow-other --dir-mode 0777 --file-mode 0777 s3fs.CUSTOMER /mnt/s3fs
- --- MISSING SETUP FSTAB ---
- 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