feat: 支持同步管理专项数据迁移 - #1
Merged
Merged
Conversation
同步管理专项: 1.新增 V2 同步管理表识别与专项升级流程 2.补充数据源表及同步任务 JSON 中的 datasourceRole 3.转换 PostgreSQL 数据源类型、任务状态、运行日志和任务锁 4.增加异常同步任务参数校验及迁移统计 5.迁移 PostgreSQL 源端、目标端插件及插件元数据 迁移工具优化: 1.支持本地与远程服务器的四种文件迁移组合 2.调整 SSH 参数为远程服务器条件必填 3.增加同步任务物理日志可选迁移配置 4.优化 JDBC 批量写入、提交策略及进度日志 5.优化插件幂等更新、事务处理和驱动路径转换 6.完善迁移阶段日志、错误根因、代码注释、页面说明
There was a problem hiding this comment.
Pull request overview
该 PR 增强 DataEase 2.0 → 3.0 迁移工具,新增“同步管理专项”迁移能力(识别同步表、升级/转换同步数据、安装 PostgreSQL 同步插件),并优化整体迁移流程(本地/远程文件组合迁移、可选迁移同步任务物理日志、JDBC 批量写入策略与日志可观测性)。
Changes:
- 新增同步管理专项迁移:新增专项 SQL 升级脚本与专项迁移服务,转换同步数据源类型/角色、任务参数 JSON、任务状态、日志与锁,并安装 PostgreSQL 同步源/目标插件。
- 迁移工具流程优化:支持源端/目标端分别按本地或 SSH 访问,新增同步任务物理日志可选迁移开关,完善阶段化耗时与失败根因输出。
- 插件与 JDBC 迁移改进:插件元数据按 module/name 兼容更新并支持幂等插入;JDBC 迁移启用批量改写、分段提交与进度日志。
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/sync-upgrade.sql | 新增同步管理专项的数据转换 SQL(类型/角色/参数/状态/锁等)。 |
| src/main/resources/static/index.html | 表单文案与 SSH 参数“远程必填”提示,补充连接方式说明。 |
| src/main/resources/static/app.css | 为新增连接方式说明区域补充样式。 |
| src/main/resources/application.yml | 新增同步任务物理日志复制开关配置项。 |
| src/main/java/com/dataease/migration/service/SyncManagementMigrationService.java | 新增同步管理专项迁移编排与校验/统计/脚本执行逻辑。 |
| src/main/java/com/dataease/migration/service/PluginMigrationService.java | 拆分通用/同步插件,支持 driverPath 重写,插件记录按 module/name 幂等更新/插入。 |
| src/main/java/com/dataease/migration/service/MigrationService.java | 迁移主流程调整:本地/远程文件迁移组合、可选同步日志迁移、阶段耗时/失败根因输出、调用专项迁移。 |
| src/main/java/com/dataease/migration/service/MigrationJob.java | SSE 完成事件区分成功/失败提示信息。 |
| src/main/java/com/dataease/migration/service/JdbcDatabaseMigrator.java | 目标端连接批量写入优化、分批提交与迁移速率/耗时日志。 |
| src/main/java/com/dataease/migration/model/ServerInfo.java | 服务器信息改为 SSH 字段条件校验(由服务层按本地/远程判断)。 |
| README.md | 更新迁移流程说明、本地迁移说明、同步日志开关说明等。 |
| .gitignore | 允许提交 plugins/*.jar(迁移发行包依赖)。 |
Suppressed comments (1)
src/main/java/com/dataease/migration/service/MigrationService.java:315
buildSyncTaskLogArchiveCommand同样使用&& du -h,会让日志输出命令成为硬依赖;在缺少du时会把本可成功的同步日志归档步骤判定为失败。建议将du改为不影响整体返回码的可选输出。
+ "tar -czf " + ShellEscaper.quote(archive) + " -T /dev/null; fi"
+ " && du -h " + ShellEscaper.quote(archive);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # DataEase 数据迁移工具 | ||
|
|
||
| 浏览器访问 `http://localhost:8080`,填写 DataEase 2.0 和 3.0 的 SSH、MySQL 及安装目录信息后执行迁移。 | ||
| 浏览器访问 `http://localhost:9888`,填写 DataEase 2.0 和 3.0 的服务器地址、MySQL 及安装目录信息后执行完整迁移。远程服务器通过 SSH 操作,本地服务器直接操作本地目录。 |
Comment on lines
+303
to
+304
| + "tar -czf " + ShellEscaper.quote(remoteArchive) + " \"$@\"" | ||
| + " && du -h " + ShellEscaper.quote(remoteArchive); |
Comment on lines
+373
to
+377
| static boolean sameDatabase(DatabaseConnection source, DatabaseConnection target) { | ||
| if (source.port() != target.port() || !source.database().equals(target.database())) { | ||
| return false; | ||
| } | ||
| if (source.host().equalsIgnoreCase(target.host())) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
同步管理专项:
1.新增 V2 同步管理表识别与专项升级流程
2.补充数据源表及同步任务 JSON 中的 datasourceRole
3.转换 PostgreSQL 数据源类型、任务状态、运行日志和任务锁
4.增加异常同步任务参数校验及迁移统计
5.迁移 PostgreSQL 源端、目标端插件及插件元数据
迁移工具优化:
1.支持本地与远程服务器的四种文件迁移组合
2.调整 SSH 参数为远程服务器条件必填
3.增加同步任务物理日志可选迁移配置
4.优化 JDBC 批量写入、提交策略及进度日志
5.优化插件幂等更新、事务处理和驱动路径转换
6.完善迁移阶段日志、错误根因、代码注释、页面说明