DEV Community

Jakub Dubec
Jakub Dubec

Posted on

10 1

Migrating data between two online MinIO instances

Introduction

I use MinIO to store data for my personal Docker containers. It's super easy to use in applications and it solves problem data persistence in Docker (it's much more flexible than using volumes - sure, it also depends on the use-case).

Even though I am a quite satisfied developer I have to admit I struggled for a while trying to find out how to migrate data between two online MinIO instances. There is a GitHub issue for this situation but the response there is quite disappointing. I had to dig into documentation to find the response.

This article is for those who are lazy as I am and love quick straightforward solutions.

Preparation

We are going to use an official MinIO client called mc. I use macOS so installation is quite easy. The process supposes to be similar on different platforms.

In this example, we are going to migrate data from my_source to my_destination. We start with creating such a configuration. The default path is in your home directory of yours (~/.mc/config.json). The file is supposed to look like this (with your values).

{
    "version": "10",
    "aliases": {
        "my_source": {
            "url": "http://<remote_ip>:9001",
            "accessKey": "my_access_key",
            "secretKey": "my_secret",
            "api": "S3v2",
            "path": "auto"
        },
        "my_destination": {
            "url": "https://data.example.com",
            "accessKey": "my_access_key",
            "secretKey": "my_secret",
            "api": "S3v4",
            "path": "auto"
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Migration

After configuration of your instances, the rest is quite simple. We are going to use a mc mirror command.

mc mirror my_source my_destination
Enter fullscreen mode Exit fullscreen mode

Simple as that!

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more