Configuring your S3 Bucket
Before you start, you need to configure your S3 Bucket Policy to enable public access to your bucket, but block unauthorized access to private attachments.
Within your bucket configuration, select the Permissions tab:

{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicReadWhereAuthNotRequired",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"NotResource": [
"arn:aws:s3:::<bucket_name>/*/*T-*",
"arn:aws:s3:::<bucket_name>/*/*PD-*",
"arn:aws:s3:::<bucket_name>/v2/*"
]
}
]
} copy
You must replace <bucket_name>
with the name of your bucket.
Configure S3 via the Webgui
Within the OPC webGUI, select the Instance page for the instance you wish to configure, scroll to the Services section and select File Storage

In the File Storage settings, click Change Storage Mechanism

In the Changing Storage Mechanism section, select Amazon S3 from the Storage Mechanism drop down, then enter your Amazon S3 settings in the fields below.

You must click Validate Details which will confirm your S3 bucket is accessible and configured correctly. Once the details are validated click Save Changes to apply.
Deskpro will automatically start migrating your files over to the S3 storage.
Configure S3 via the CLI
The following OPC command will configure your instance to use S3, and begin the migration process:
opc inst -i {instanceID} config set file-storage s3 --s3-cred-source key --s3-bucket-name {bucket_name} --s3-region {bucket_region} --s3-key {access_key} --s3-secret {secret_key} copy
The variables need to be changed with the following:
{instanceID}
- The ID of your instance{bucket_name}
- The name of your S3 bucket{bucket_region}
- The region your S3 bucket is in{access_key}
- The access key for your S3 bucket{secret_key}
- The secret paired with your access key
Once configured, the OPC will begin the migration to S3. To check the status of the migration, you can run the following command:
opc inst -i {instanceID} php -- dpv5/bin/console dp:move-blobs copy
This will output a table showing the number of blobs and their location, and if any blobs are in the process of migrating.
Please log in or register to submit a comment.