I have a few Amazon AWS S3 buckets. I currently have a script that periodically backs those up to my NAS for archiving.
My NAS is a TrueNAS box, which has what seems like a well-supported MinIO docker app.
Can I use MinIO to handle the syncing of data between the remote S3 instance and MinIO buckets?
You can, but it’s not as simple as just configuring it in minio and calling it a day. Minio supports replication on the server side, but both endpoints must be running the same version of minio.
The solution for your use case would be to use the mc command line client. Specifically, the mc mirror command.
Here’s the docs for the mc mirror subcommand, which should help you out. You’ll need to set up an IAM role, sample role below.
https://min.io/docs/minio/linux/reference/minio-mc/mc-mirror.html#continuously-mirror-s3-bucket-to-an-s3-compatible-host
Before you start the mirroring process, you’ll need to set up aliases for both minio and the aws profile. Docs found here:
https://min.io/docs/minio/linux/reference/minio-mc/mc-alias.html
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "s3_read_for_replication",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::$BUCKET_NAME/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket",
],
"Resource": [
"arn:aws:s3:::$BUCKET_NAME"
]
}
]
}
1 Like