BCDevOps / OpenShift4-Migration

Scripts and info for Ministry teams migration from OpenShift 3.11 to 4.x
Apache License 2.0
3 stars 0 forks source link

What are some of the way to migrate a Minio instance with data to the OCP 4 Platform? #9

Closed mitovskaol closed 2 years ago

mitovskaol commented 3 years ago

@jleach can you please add the steps

BcGovNeal commented 3 years ago

I have created a very simple Docker image layered on top of the official Minio Client docker image to assist Minio data migration between clusters.

This image can be run on OpenShift to enable cluster to cluster data migration.

The documentation ca be found in my repo at https://github.com/BcGovNeal/minio-client

jefkel commented 3 years ago

That's a great idea @BcGovNeal . With the mc cli tool you're not just limited to mirroring between minio deployments, but you can use those notes to replicate to any S3 compatible datastore too! (like the Hosting Services Object Storage - see https://github.com/BCDevOps/OpenShift4-Migration/issues/59 for more detail)

BcGovNeal commented 3 years ago

I have an alternative method to sync files from Minio to another Minio instance or other S3 services The reason I'm using this alternative method is because it can achieve much higher transfer speeds and it's more reliable in my own testing.

The alternative method works by running the mc cli tool directly in the source Minio instance on OCP. The trick is to run the mc cli with the --config-dir or -C Global Options and set it to a directory that the user has write access to. For example, if you're using the openshift/minio image then it can be set to /opt/minio/.mc. By default, the mc cli will try to create the .mc directory in the root, which will encounter access denied error. This is why the --config-dir option is needed.

Example usage

# Download mc cli to /opt/minio/mc
curl https://dl.min.io/client/mc/release/linux-amd64/mc -o /opt/minio/mc

# Set execute permission, may not be needed
chmod +x /opt/minio/mc

# Set sync target alias
/opt/minio/mc -C /opt/minio/.mc alias set target https://yourtargetservice.com your--access-id your-access-secret

# Sync Minio data to the target service bucket, assuming Minio data is stored in /data/uploads
/opt/minio/mc -C /opt/minio/.mc mirror /data/uploads target/bucketname