Easily Migrate DataBase Data in Just 3 Steps, Even for Beginners
Published: 2024-06-21 01:48:00

I believe that in your daily development work, you often encounter various business scenarios that require data migration. If you want to quickly migrate data without the hassle of coding, find a handy tool that can make this task easy and efficient. With just 3 simple steps, even beginners can easily get started!

We use MySQL database as an example, other databases are similar.

**Required Tool**

**SQLynx :** A compact, portable database management and development tool, available for free in the personal version. It supports managing multiple data sources simultaneously, with a clean and user-friendly interface. 

**Step 1**
Open the source table you want to migrate, which we'll refer to as Table A for clarity. To facilitate the process, you can start by copying the DDL statement of Table A.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkn8e7vkyihnmc9o8rw9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ml3lrxz0e2u3mxoekcv1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gaes6ti7o7mp1d6z7i8c.png)

**Step 2**
Open the destination database where you want to migrate the data. Based on the copied DDL, create a new table in this location. We'll refer to this table as Table B.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqf9jsguvdrzy2md1wk4.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bi0g2a6iqje2bb96gdun.png)

Copy the DDL statement you just copied, you can modify the table name in the statement, and then click the execute button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqd5002pcsntoc8le1nr.png)

**Step 3**
To begin the migration, right-click on the source table Table A, then click on "Data Migration." Simply configure the row count and other parameters, and then start the migration process!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/upbp9obj6znlohkq5760.png)

Select the target table. You can also match fields, but since the fields in both tables are the same, we don't need to do field matching here.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8mawmwovcomsurpqjnk.png)

You can view the execution status and logs in the Task Center

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7skmz885kv44grjeg71.png)

**Performance：**
We have conducted tests where the table to be migrated is approximately 1.6GB with 12 fields and 13 million rows of data. Without any specific settings or optimizations, the migration was completed in 348 seconds. We also tested the same table for cross-database migration to a remote server, which took 579 seconds due to factors like network transfer speed. The performance was excellent.

**Other two migration methods. **
You can choose to export an SQL file from Table A, and then import and execute the SQL file on Table B, which is also possible

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkzvysis4dk7rq19oenh.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mb7fhm2kz67kf7rcso32.png)

**Save Query Results to Table**
SQLynx supports directly migrating and saving query results to a new table. By using the "Save to Table" feature, you can store the data returned by the query directly to another location in the database without exporting it locally, further enhancing work efficiency.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05cw2g14p52ulvenn6uu.png)

Lastly, when backing up and restoring the entire database, we can also use SQLynx. It allows for convenient selection of either the entire database or specific data tables for backup to local storage or restoration. Whether you are a DBA or a developer, handling data migration at the million-level will become more streamlined and efficient.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iw6ihy2ogm7in5t3k3d4.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvies4yomi88c6b49k2m.png)

**About SQLynx**
SQLynx is a new database IDE, designed to meet the needs of professional SQL developers. You can execute queries in multiple modes. It also provides a local history which keeps track of your activity and protects your work from being lost. You can jump to any table or view by the name of the action or directly from the SQL code. This tool gives you a detailed insight into the behavior of your queries and the database engine behavior so that you can optimize your queries.
SQLynx allows you to write SQL code more quickly by providing context-sensitive code completion. Completion can detect the table structure, foreign keys and even database objects that were created in the code you are editing.
Sqlynx can be installed in your own Linux, Mac, and Windows environments.

Download：https://www.sqlynx.com/en/#/home/probation/SQLynx