Data Migration, Backup and Recovery of Minio in Windows Environment

1. Please make sure that the Minio client has been installed on the server (installed can be ignored)

Download the client file for Windows
Download the client file for Windows

Install Minio client:

# 1. 创建客户端安装目录,比如:D:\minio
# 2. 将下载 的mc.exe文件复制到D:\minio目录下
# 3. 打开cmd窗口,切换到D:\minio目录
cd D:\minio

At this point, the Minio client is installed.

2. Server Description

Suppose there are two Minio servers now, one is server A deployed in Windows environment and the other is server B deployed in Linux environment, and all operations are performed on server A.

3. Set an alias for the Minio server

Set up aliases for server A and server B respectively on server A

# 打开cmd窗口,切换到客户端文件所在目录(D:\minio)
cd D:\minio
# 在服务器A设置服务器A的别名
mc alias set minio_data_local http://localhost:9000 yourusername youruserpassword
# 在服务器A设置服务器B的别名
mc alias set minio_data_B http://22.22.22.220:9000 yourusername youruserpassword
# 查看已设置的Minio服务器的别名,看到上面设置的两个别名在列出的列表中即OK
mc alias list

Description :
(a) minio_data_local and minio_data_B are the aliases set;
(b) http://localhost:9000 and http://22.22.22.220:9000 are server addresses;
(c) yourusername indicates the user account of Minio service on the server;
(d) youruserpassword indicates the user password of Minio service on the server.

4. Migrate data from Linux server B to Windows server A

# 打开cmd窗口,切换到客户端文件所在目录(D:\minio)
cd D:\minio
# 将Linux服务器B上名为“bucket-demo”的桶的数据迁移到Windows服务器A的“bucket-demo”桶中
mc cp --recursive minio_data_B/bucket-demo/ minio_data_local/bucket-demo/
# 将Linux服务器B上所有数据迁移到Windows服务器A中
mc cp --recursive minio_data_B minio_data_local

Note :
When migrating all the data of a certain server at one time (without specifying the bucket name), all the buckets on the migration server must exist on the new server, otherwise it will prompt that the corresponding bucket cannot be found and the data cannot be migrated.

5. Back up the data of server A

# 打开cmd窗口,切换到客户端文件所在目录(D:\minio)
cd D:\minio
# 将Windows服务器A上名为bucket-demo的桶的数据备份到D:\minio\backup\bucket-demo目录
mc cp --recursive minio_data_local/bucket-demo/ D:\minio\backup\bucket-demo
# 将Windows服务器A上的所有数据备份到D:\minio\backup目录
mc cp --recursive minio_data_local D:\minio\backup

6. Restore data according to the backup file

# 打开cmd窗口,切换到客户端文件所在目录(D:\minio)
cd D:\minio
# 将D:\minio\backup目录下的备份数据恢复到服务器B,注意备份文件目录路径需以'\'结尾
mc cp --recursive D:\minio\backup\ minio_data_B
# 将某个桶(比如:bucket-demo)的备份数据恢复到服务器A的指定桶(比如:bucket-demo2)中
mc cp --recursive D:\minio\backup\bucket-demo minio_data_local/bucket-demo2

Note :
When migrating, backing up and restoring data, if a directory does not exist, just follow the prompt to create it.

Guess you like

Origin blog.csdn.net/HLXTU/article/details/130872453