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