dbswitch: Offline Bulk Migration to Nearly 30 Databases, DDL Auto-Generated
01 Introduction
The previous article covered a database sync tool called DBSyncer. In the past couple of days I spotted another open source project on Gitee — dbswitch — with similar functionality. It's also a project under the domestic community dromara. Let's take a look at how this project holds up!
02 Overview
dbswitch is a member project of the Dromara open source community, developed entirely in Java, released under the BSD open source license. The dbswitch tool provides offline batch migration and sync from source databases to destination databases, supporting full, incremental, and changed-data (CDC) sync.
It was born out of two major scenarios: data movement between databases and data ingestion into warehouses or data lakes. Core capabilities:
- Structure migration: automatic conversion of field types, primary key information, and table creation statements, directly generating target database DDL; also supports regex-based table/field name mapping transformations.
- Data sync: reads source data in batches via
JDBC, then writes to the target in batches efficiently usinginsert/copyand similar approaches, supporting full, incremental, and CDC modes. - Incremental change sync: for tables with primary keys, supports
insert/update/deleteincremental sync based on row comparison. - Very broad database coverage:
MySQL,Oracle,SQL Server,PostgreSQL,DB2,MariaDB,SQLite,Sybase; the full domestic Chinese lineup — 达梦DM, 人大金仓Kingbase8, 瀚高HighGo, 神通Oscar, 南大通用GBase8a,OpenGauss,OceanBase; big data direction —Hive,ClickHouse,StarRocks,Doris,Greenplum,MongoDB,Elasticsearch... nearly 30 types. A driver isolation architecture supports custom data source extensions. - Two usage modes: a
Vue2-based Web management interface (data source configuration, task management, monitoring scheduling, audit logs) and aconfig.yml-based command line mode that handles large numbers of tables without issue. - Extras: table structure viewing, an online
SQLquery page,Quartzscheduling, and secondary development integration support.
Gitee address: https://gitee.com/dromara/dbswitch
03 Installation and deployment
Environment requirements: JDK >= 1.8, Maven >= 3.6 (if building from source). After building, dbswitch-release-x.x.x.tar.gz is generated in the target/ directory; copy it to a machine with JRE installed and extract. For most people, Docker is the easiest route. Official images support multiple configuration-store modes.
3.1 Build and package
Windows:
Double-click the build.cmd script to compile and package
Linux:
git clone https://gitee.com/inrgihc/dbswitch.git
cd dbswitch/
sh ./build.sh
Docker:
git clone https://gitee.com/inrgihc/dbswitch.git
cd dbswitch/
sh ./docker-maven-build.sh
3.2 Docker deployment
docker deployment supports different config backends: h2, Mysql, PostgreSQL, OpenGauss.
Set via the DBTYPE parameter. Using Mysql as an example:
docker run -d --name dbswitch \
-e DBTYPE=mysql \
-e MYSQLDB_HOST=127.0.0.1 \
-e MYSQLDB_PORT=3306 \
-e MYSQLDB_USERNAME=root \
-e MYSQLDB_PASSWORD='root' \
-e MYSQLDB_NAME='dbswitch' \
-v /tmp:/tmp \
-p 9088:9088 \
registry.cn-hangzhou.aliyuncs.com/inrgihc/dbswitch:2.0.1
04 Hands-on
We'll use Docker deployment as the example.

Then visit IP + port to see the Web page. Account/password: admin/123456

Dashboard:

4.1 Adding a data source
Supported data sources:

Add connection:

Connection list:

4.2 Migration tasks

Add task information

Source configuration:

Target configuration:

Task list:

From the configuration, sync can only run via scheduled tasks. This isn't friendly for scenarios with high real-time requirements. Testing shows the minimum interval for scheduled tasks is 120s.
4.3 Starting tasks
You can check the dashboard or the scheduled tasks view.

05 Summary
dbswitch compensates for DBSyncer's automatic table creation gap, but its near-real-time (120s) limitation may be the biggest drawback for many scenarios. If you like tinkering, give it a try.
Top 2 of 4 from juejin.cn, machine-translated. The original thread is authoritative.
Have been using it for a few days.
It can't sync in real time, can you tolerate that? [chuckle]
I use it for database backup; I only run it once a day.
I've used Kingbase's kdts; there were failures migrating functions and views.