MySQL database migration method based on domestic vast high database
Through standardized processes and automation tools, the technical challenges in the migration of MySQL database to domestic Hangao databases were solved, efficient and reliable migration and performance optimization were achieved, and data integrity and system compatibility were ensured.
Patent Information
- Application Number
- CN202510437150.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
AI Technical Summary
During the transformation of information and innovation, the migration of MySQL database to domestic Hangao database faces technical challenges such as SQL syntax differences, transaction processing mechanisms and performance characteristics differences. The existing technical methods have low migration efficiency, compatibility problems and data consistency risks, making it difficult to achieve efficient and reliable migration.
Through standardized processes of environment analysis and adaptation, data migration, code adaptation and performance optimization, including automated migration tools, static code analysis, configuration file modification and SQL statement conversion, the mapping relationship between MySQL and Hangao database is established to ensure the efficiency and compatibility of the migration process.
It realizes efficient migration of MySQL database to Hangao database, improves migration efficiency, ensures data integrity and consistency, improves system performance and compatibility, and reduces migration costs and risks.
Smart Images

Figure CN120371815A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database migration, and in particular to a method for migrating a MySQL database based on the domestic HighGo database, which is applicable to the efficient migration, compatibility adaptation and performance optimization of databases during the domestic information technology innovation transformation process. Background Art
[0002] With the rapid development of information technology and the in-depth promotion of the national information security strategy, information technology application innovation (IT innovation) has become an important direction to promote the independent control of China's information technology industry. The core goal of the IT innovation industry is to achieve a comprehensive domestic substitution from underlying hardware to upper-layer software, including key infrastructures such as chips, operating systems, databases, and middleware. In this context, domestic databases, as an important part of the IT innovation ecosystem, have gradually become the mainstream choice to replace traditional foreign databases. However, during the IT innovation transformation process, migrating widely used traditional databases (such as MySQL) to domestic databases (such as HighGo database) faces many technical challenges and practical problems.
[0003] 1. As an open-source relational database management system (RDBMS), MySQL has been widely used globally due to its high performance, ease of use, and rich functional features. The core business systems of many enterprises and institutions rely on the MySQL database, covering multiple fields such as finance, telecommunications, government affairs, and education. However, with the changes in the international situation and the improvement of information security requirements, the application of traditional foreign databases in key areas has gradually been restricted. Especially in the context of IT innovation transformation, migrating traditional databases such as MySQL to domestic databases has become an urgent need.
[0004] 2. In recent years, significant progress has been made in domestic database technology, and a number of database products with independent intellectual property rights have emerged, such as HighGo database, DM database, KingbaseES, etc. These domestic databases are gradually approaching or even surpassing foreign counterparts in terms of functions, performance, and stability, and have been widely used in key areas such as government affairs, finance, and energy. However, there are significant differences between domestic databases and foreign databases in terms of technical architecture, syntax specifications, performance characteristics, etc., which pose huge challenges to the migration of traditional databases.
[0005] During the IT innovation transformation process, the migration of the MySQL database to the HighGo database faces the following main technical differences: SQL syntax differences, transaction processing mechanisms, and performance characteristic differences.
[0006] Currently, with the rapid development of the global shipping industry and the increasing awareness of environmental protection, the management of ship fuel consumption has become an essential part of the operation and management of shipping enterprises, directly related to the enterprise's operating costs, energy conservation and emission reduction achievements, and market competitiveness. Facing the increasingly strict carbon emission regulations of the International Maritime Organization (IMO) and the rising fuel prices, how to efficiently and accurately manage ship fuel consumption has become a key issue that shipping enterprises urgently need to solve.
[0007] In summary, the migration from traditional MySQL databases to domestic HighGo databases is of great significance in the information technology application innovation transformation, but there are many limitations in existing technologies and methods. Therefore, there is an urgent need for an efficient and reliable migration method and system to solve compatibility problems, performance bottlenecks, and data consistency risks, reduce migration costs, and improve migration efficiency. Summary of the Invention
[0008] To solve the above technical problems, the present invention provides a method for migrating MySQL databases based on domestic HighGo databases, which realizes the efficient migration, compatibility adaptation, and performance optimization of databases through a standardized process.
[0009] The technical solution of the present invention is as follows:
[0010] A method for migrating MySQL databases based on domestic HighGo databases, comprising the following steps:
[0011] a) Environment analysis and adaptation: Analyze the performance characteristics and compatibility of the target HighGo database, and establish mapping relationships between the syntax, functions, stored procedures, etc. of MySQL and the HighGo database.
[0012] b) Data migration: Use an automated migration tool to migrate table structures, indexes, views, stored procedures, etc. in the MySQL database to the HighGo database, and automatically convert incompatible SQL statements and data types.
[0013] c) Code adaptation: Adapt the code in the application program that interacts with the database, replace incompatible API and function calls, and ensure that the application program can correctly operate the HighGo database.
[0014] The environment analysis and adaptation step includes: analyzing the performance characteristics of the target HighGo database, comparing the differences between MySQL and the HighGo database in terms of SQL syntax, data types, functions, stored procedures, triggers, etc., establishing a detailed mapping relationship table, analyzing third-party components used in the MySQL database, evaluating their compatibility in the HighGo database, and formulating alternative solutions.
[0015] The data migration step includes: table structure migration, data migration, stored procedure and trigger migration, view and index migration, specifically including the following steps:
[0016] 1) Table structure migration: Use an automated migration tool to export the table structure of MySQL as an SQL script, and automatically convert data types, constraint conditions, and index definitions according to the mapping relationship;
[0017] 2) Data migration: Export the data in MySQL to an intermediate format, and use the bulk import tool of HighGo Database to import the data into the target database; during the migration process, automatically handle data type conversion and encoding issues to ensure data integrity and consistency;
[0018] 3) Stored procedure and trigger migration: Export the stored procedures and triggers of MySQL as SQL scripts, and automatically convert syntax and function calls according to the mapping relationship;
[0019] 4) View and index migration: Export the views and indexes of MySQL as SQL scripts, and optimize them according to the characteristics of HighGo Database.
[0020] The code adaptation steps include: code analysis and difference identification, configuration file modification, and SQL statement conversion, where
[0021] Code analysis and difference identification
[0022] Use a static code analysis tool to scan the application code to identify the parts that interact with the database; compare the differences between MySQL and HighGo Database in terms of API, functions, and syntax, and generate a difference report;
[0023] Configuration file modification
[0024] Update the database connection configuration file of the application to ensure that it can correctly connect to the HighGo Database, including modifying the database connection string, username, password, adjusting the connection pool configuration, and optimizing connection management; replace the database driver of MySQL with the driver of HighGo Database, and update the relevant configuration, replacing the JDBC driver com.mysql.cj.jdbc.Driver of MySQL with the JDBC driver com.highgo.jdbc.Driver of HighGo Database.
[0025] SQL statement conversion
[0026] This part includes syntax conversion, data type conversion, and adaptation of stored procedures and triggers.
[0027] Syntax conversion: Convert MySQL-specific SQL syntax to syntax compatible with HighGo Database;
[0028] Data type conversion: Explicitly convert incompatible data types in SQL statements;
[0029] Stored procedure and trigger adaptation: Modify the code of stored procedures and triggers to ensure compatibility with the syntax of the HighGo database.
[0030] The beneficial effects of the present invention are
[0031] Through automated tools and standardized processes, the present invention realizes the efficient migration, compatibility adaptation, and performance optimization of the MySQL database to the HighGo database.
[0032] (1) Improve migration efficiency: Through the automated migration tool and standardized process, the present invention can quickly complete the migration task of the MySQL database to the HighGo database.
[0033] (2) Improve data accuracy: Introduce data preprocessing technology and outlier detection technology to ensure the accuracy and integrity of data, and thus improve the data reliability of the system after migration.
[0034] (3) Improve system performance: By optimizing query statements, index design, and transaction processing logic, the present invention significantly improves the response speed and throughput of the database.
[0035] (4) Improve compatibility: By establishing the syntax and function mapping relationship between MySQL and the HighGo database, the compatibility problems of objects such as SQL statements, stored procedures, and triggers are comprehensively solved.
[0036] (5) Reduce migration costs and risks: Through a set of standardized processes, the present invention significantly reduces the manpower input during the migration process and reduces the migration cost. Description of the drawings
[0037] Figure 1 It is a schematic diagram of the work flow of the present invention. Detailed implementation manners
[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0039] The present invention provides a method for migrating a MySQL database based on the domestic HighGo database, which realizes the efficient migration and optimization of the MySQL database to the HighGo database through steps such as environment analysis, automated migration, code adaptation, performance optimization, test verification, and deployment monitoring. The specific technical solutions include the following key steps:
[0040] Environmental analysis and adaptation:
[0041] The purpose of this step is to comprehensively understand the characteristics of the target HighGo database and identify the differences from the MySQL database. First, analyze the performance characteristics of the HighGo database on domestic hardware, including CPU utilization, memory management, disk I / O, etc., to provide a basis for subsequent performance optimization. Then, conduct a compatibility assessment, compare the differences between MySQL and the HighGo database in terms of SQL syntax, data types, functions, stored procedures, triggers, etc., and establish a detailed mapping table. For example, map AUTO_INCREMENT in MySQL to Sequence in the HighGo database, and map the LIMIT syntax in MySQL to the FETCH FIRST syntax in the HighGo database; analyze third-party components used in the MySQL database (such as storage engines, plugins, etc.), evaluate their compatibility in the HighGo database, and develop alternative solutions.
[0042] Data migration:
[0043] Data migration is the core link of the migration process. Its goal is to migrate table structures, indexes, views, stored procedures, etc. in the MySQL database to the HighGo database and ensure data integrity and consistency. The specific steps are as follows:
[0044] 1. Table structure migration: Use an automated migration tool (HighGo database migration tool) to export the table structure of MySQL as an SQL script, and automatically convert data types, constraint conditions, and index definitions according to the mapping relationship. For example, convert TINYINT in MySQL to SMALLINT in the HighGo database, and convert the UTF8MB4 character set in MySQL to the UTF8 character set in the HighGo database.
[0045] 2. Data migration: Export the data in MySQL to an intermediate format (such as CSV or SQL script), and use the bulk import tool of the HighGo database to import the data into the target database. During the migration process, automatically handle data type conversion and encoding issues to ensure data integrity and consistency.
[0046] 3. Stored procedure and trigger migration: Export the stored procedures and triggers in MySQL as SQL scripts, and automatically convert syntax and function calls according to the mapping relationship. For example, replace the DELIMITER syntax in MySQL with the equivalent syntax in the HighGo database, and replace the IFNULL function in MySQL with the COALESCE function in the HighGo database.
[0047] 4. View and Index Migration: Export the views and indexes of MySQL as SQL scripts and optimize them according to the characteristics of HighGo Database. For example, adjust the index type and field order to improve query performance.
[0048] Code-level Adaptation:
[0049] Code adaptation is a key link to ensure that the application can operate the HighGo Database correctly. The specific contents include the following:
[0050] 1. Code Analysis and Difference Identification
[0051] Use static code analysis tools to scan the application code, identify the parts interacting with the database, including SQL statements, API calls, transaction management, etc.; compare the differences between MySQL and HighGo Database in terms of API, functions, syntax, etc., and generate a difference report.
[0052] 2. Configuration File Modification
[0053] Update the database connection configuration file of the application to ensure that it can correctly connect to the HighGo Database, including modifying parameters such as the database connection string, username, password, etc., adjusting the connection pool configuration, and optimizing connection management. Replace the database driver of MySQL with the driver of HighGo Database and update the relevant configuration. Replace the JDBC driver com.mysql.cj.jdbc.Driver of MySQL with the JDBC driver com.highgo.jdbc.Driver of HighGo Database.
[0054] 3. SQL Statement Conversion
[0055] This part involves syntax conversion, data type conversion, and adaptation of stored procedures and triggers.
[0056] Convert the SQL syntax unique to MySQL into the syntax compatible with HighGo Database. For example, replace LIMIT offset,count with OFFSET offset FETCH FIRST count ROWS ONLY; explicitly convert incompatible data types in SQL statements, such as replacing DATETIME with TIMESTAMP, etc.; modify the code of stored procedures and triggers to ensure their compatibility with the syntax of HighGo Database, such as replacing the DELIMITER syntax of MySQL with the equivalent syntax of HighGo Database.
[0057] The above description is only the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for migrating a MySQL database based on the domestic HighGo database, comprising the following steps: a) Environment analysis and adaptation: Analyze the performance characteristics and compatibility of the target HighGo database, and establish a mapping relationship between MySQL and the HighGo database; b) Data migration: Use an automated migration tool to migrate the table structure, indexes, views, and stored procedures in the MySQL database to the HighGo database, and automatically convert incompatible SQL statements and data types; c) Code adaptation: Adapt the code in the application that interacts with the database, replace incompatible APIs and function calls, and ensure that the application can correctly operate the HighGo database.
2. The method according to claim 1, wherein the environment analysis and adaptation step includes: analyzing the performance characteristics of the target HighGo database, comparing the differences between MySQL and the HighGo database in SQL syntax, data types, functions, stored procedures, and triggers, establishing a mapping relationship table, analyzing the third-party components used in the MySQL database, evaluating their compatibility in the HighGo database, and formulating an alternative solution.
3. The method according to claim 1, wherein the data migration specifically includes the following steps: 1) Table structure migration: Use an automated migration tool to export the table structure of MySQL as an SQL script, and automatically convert data types, constraint conditions, and index definitions according to the mapping relationship; 2) Data migration: Export the data in MySQL to an intermediate format, and use the bulk import tool of the HighGo database to import the data into the target database; During the migration process, automatically handle data type conversion and encoding issues to ensure the integrity and consistency of the data; 3) Stored procedure and trigger migration: Export the stored procedures and triggers of MySQL as an SQL script, and automatically convert the syntax and function calls according to the mapping relationship; 4) View and index migration: Export the views and indexes of MySQL as an SQL script, and optimize them according to the characteristics of the HighGo database.
4. The method according to claim 1, wherein the code adaptation step includes: code analysis and difference identification, configuration file modification, and SQL statement conversion.
5. The method according to claim 4, wherein Code analysis and difference identification Use a static code analysis tool to scan the application code to identify the parts that interact with the database; compare the differences between MySQL and the HighGo database in terms of APIs, functions, and syntax, and generate a difference report.
6. The method according to claim 4, wherein Configuration file modification Update the database connection configuration file of the application to ensure that it can correctly connect to the HighGo database, including modifying the database connection string, username, password, adjusting the connection pool configuration, and optimizing connection management; replace the database driver of MySQL with that of the HighGo database and update the relevant configuration, replacing the JDBC driver com.mysql.cj.jdbc.Driver of MySQL with the JDBC driver com.highgo.jdbc.Driver of the HighGo database.
7. According to the method described in claim 4, wherein SQL statement conversion This part includes syntax conversion, data type conversion, and adaptation of stored procedures and triggers.
8. According to the method described in claim 7, wherein Syntax conversion: Convert the SQL syntax unique to MySQL into the syntax compatible with the HighGo database; Data type conversion: Explicitly convert incompatible data types in the SQL statement; Adaptation of stored procedures and triggers: Modify the code of stored procedures and triggers to ensure their compatibility with the syntax of the HighGo database.