Hi all,
as the amount of documentation about storing attachments in S3 storage is not much I’ve done some reverse engineering with a bit of try&error on my own and would like to share my earned knowledge with you. Please keep in mind that I’m not from the support stuff and just want to shed some light into the dark for other users.
Please do NOT copy & execute these commands without knowing what these commands do.
I will not take over any guarantee if you will result in data loss or destroy your environment.
I’ve done the successful migration from “files” to “s3” with kopano-server version is 8.7.80.307.3 using my notes below:
pkill kopano-server (stop kopano server)
mkdir /tmp/migrate
cp -ar /var/lib/kopano/attachments /tmp/migrate
cd /tmp/migrate
mkdir kopano-attachments
find -type f -exec mv {} kopano-attachments/ \;
find -type d -empty -delete
cd kopano-attachments
gzip -d *.gz
mv /var/lib/kopano/attachments /var/lib/kopano/attachments_old``
upload the folder kopano-attachments to your s3 bucket.
Change the configuration as follow:
attachment_storage = s3
attachment_path = kopano-attachments (IMPORTANT: no leading / name of your subfolder in basket)
#attachment_files_fsync = yes
#attachment_compression = 6
attachment_s3_hostname = s3.eu-central-1.amazonaws.com
attachment_s3_region = eu-central-1
attachment_s3_protocol = https
attachment_s3_uristyle = path
attachment_s3_accesskeyid = abc1234abc1234
attachment_s3_secretaccesskey = abc1234+abc1234+abc1234
attachment_s3_bucketname = mybasketname
At first start of kopano-server uses the parameter “ignore parameter” as attachment storage was moved
/usr/sbin/kopano-server -F --ignore-attachment-storage-conflict
Open some attachments within your webapp to see if they are downloading correctly.
After this stop the manually started kopano-server and start the service daemon again.
I hope these notes will help you to save your time and headache ;-)
If you like you can spent me a coffee ;-)
@fbartels, thanks for your hint about the folder structure.
Regards
Timo