Skip to main content

Moving files to S3 storage

Create a bucket at AWS

  1. Select same region as server is hosted in
    1. Go to https://eu-north-1.console.aws.amazon.com/s3/buckets
  2. Add bucket
  3. Select Directory if files are mainly media (pictures/video)
  4. Name the bucket: s3fs.CUSTOMER

Add IAM role to server

  1. Go to https://eu-north-1.console.aws.amazon.com/ec2/home
  2. Right click server > Security > Modify IAM role
  3. Choose ServerWithNetworkFilesystem
  4. Update IAM role

Install the mountpoint

  1. wgetInstall software: https://s3.amazonaws.docs.aws.amazon.com/AmazonS3/latest/userguide/mountpoint-s3-release/latest/x86_64/mount-s3.rpminstallation.html
  2. sudoMake yuma installfolder ./mount-s3.rpm -y
    1. sudo nano /etc/fuse.conf
      • remove # before user_allow_other
      • save file
    2. sudo mkdir /mnt/s3fs
  3. Test the mount
    1. sudo mount-s3 --allow-other --dir-mode 0777 --file-mode 0777 s3fs.CUSTOMER /mnt/s3fs
  4. ---Unmount MISSINGagain SETUP
      FSTAB
    1. sudo umount /mnt/s3fs
  5. Modify fstab for automatic mount
    1. sudo nano /etc/fstab
    2. 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
  6. Try the fstab mount
    1. sudo mount ---a
  7. Option for multi instance server: sudo mkdir /mnt/s3fs/<instancename>

Change storage location and policy

  1. Go to Server > Backend > Modules > Configuration
  2. Change filesystemStorageBasePath: /mnt/s3fs
    • Option for multi instance server: /mnt/s3fs/<instancename>
  3. Change filesystemStorageActive: true

Migrate existing files til S3

  1. Call server URL
    • Manual: main?command=dk.tempusserva.codeunit.system.PageConvertBlobsToFiles
    • Full auto: main?command=dk.tempusserva.codeunit.system.PageConvertBlobsToFiles&convert