File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ title : ' 如何迁移到其他S3存储'
3+ sidebar_position : 9
4+
5+ ---
6+
7+ # S3存储接入
8+
9+ ### 获取最新代码
10+ 请下载项目的最新代码版本:
11+ - 最新代码已集成` S3 ` 迁移工具,无需单独操作。
12+ ``` shell
13+ git clone https://github.com/openimsdk/open-im-server.git
14+ cd open-im-server
15+ ```
16+
17+ ### 配置文件修改指南
18+ 请根据需要修改` config ` 目录下的相关配置文件,以完成迁移相关的 S3 配置:
19+ 1 . 编辑` openim-rpc-third.yml ` 配置文件
20+ - 定位并更新与 S3 相关的配置项,确保其符合您的实际迁移需求。
21+ 2 . 关于 minio.yml 配置文件
22+ - 如果项目中未实际使用 MinIO,该文件可以忽略。
23+ - 如需使用,请同样根据迁移需求更新 S3 配置相关项。
24+ 3 . ` openim-rpc-third.yml ` 中都有` object.enable ` 字段,用于指定新的S3存储引擎。
25+
26+ ### 编译S3迁移工具
27+ 1 . 进入工具目录
28+ ``` shell
29+ cd tools/s3
30+ ```
31+ 2 . 执行编译命令
32+ ``` shell
33+ go build -o s3convert main.go
34+ ```
35+
36+ ### 开始迁移
37+ 为确保数据迁移过程的稳定性,请按照以下建议进行操作:
38+ 1 . 准备工作
39+ - 关闭服务:建议在服务停止的状态下进行迁移操作,以避免数据不一致或操作冲突。
40+ - 备份 MongoDB:重点备份` s3 ` 表的数据,以便在发生意外时快速恢复。
41+ 2 . 迁移说明
42+ - 迁移工具不会删除原有的` S3 ` 数据,但会修改` MongoDB ` 中` s3 ` 表的相关记录。
43+ - 请在迁移完成后,核对数据完整性,确保所有迁移步骤正确执行。
44+ 3 . 执行迁移命令
45+ - ` <config dir path> ` :指定配置文件目录路径。
46+ - ` <old s3 name> ` :填写原 S3 配置名称,例如 minio。
47+ ``` shell
48+ ./s3convert -config < config dir path> -name < old s3 name>
49+ ```
50+ 4 . 示例命令
51+ 如配置文件位于 config 目录下,且原 S3 名称为 minio,可执行以下命令:
52+ ``` shell
53+ ./s3convert -config ./../../config -name minio
54+ ```
55+ 当看到输出信息` success ` 时,表示迁移操作已完成。
You can’t perform that action at this time.
0 commit comments