Full library migration tool - mxshift

YMatrix uses the mxshift tool to perform library data migration operations.

The mxshift tool currently supports the following features:

  • Full migration: In units of database, implement parallel migration of data table data definition language (DDL) and data from Greenplum 4.3.X/5/6 / YMatrix cluster to the new YMatrix cluster.
  • Incremental migration: In units of tables, implement the data definition language (DDL) and data added to the new data table in the target database from the Greenplum 5/6 / YMatrix cluster to the new YMatrix cluster.
  • Conditional migration: Conditional migration of data is realized through the WHERE condition.
  • Supported data distribution strategies: hash distribution, random distribution, replication table (REPLICATED), Master-only.

1 mxshift principle

![](https://img.ymatrix.cn/ymatrix_home/mxshift full library migration (screenshot)_1693981579.png)

If the data migration process is likened by water flowing through the pipeline and the data transmission efficiency is likened by water flow rate, then the water flow rate is often limited to a low value as a whole because of the "narrowest part of the pipeline", resulting in the so-called "single-point bottleneck".

With this in mind, the mxshift tool implements data transfer from the Segment directly to the Segment, eliminating single point bottlenecks that may occur in common migration operations. When the topology of the source cluster and the target cluster are inconsistent, that is, heterogeneous, mxshift can also calculate the optimal mapping scheme based on the number of source cluster segments, the number of target cluster segments, whether the segment is on the same physical machine, etc., to realize automated data migration.

2 mxshift Usage

mxshift runs as a configuration file. First, edit the configuration file config.toml.

Notes!
For the complete configuration file, see mxshift.


$ vim config.toml

[database] [database.source] db-database= "testdb" db-host="sdw3" db-password="xxxx" db-port=54322 db-user="mxadmin"

[database.target]
    db-database="destdb"
    db-host="172.16.100.32"
    db-password="yyyy"
    db-port=5432
    db-user="mxadmin"

[scope] install-dir="/usr/local/greenplum-db-6.7.1"

After you have prepared the TOML file, execute the following command to start mxshift for migration.

$ mxshift -c config_path.toml


> ***Notes!***  
For the complete parameters and usage of mxshift, please see [mxshift](/doc/5.2/tools/mxshift).