2025/12/12
Share
Oracle to MariaDB Data Migration Tool
Project Overview
We developed and integrated a tool to support the database migration process from Oracle to MariaDB.
In this project, while the migration of the structure and environment had been completed, the migration of the actual data remained unfinished. To complete the migration from the legacy system (Oracle) to the new system (MariaDB), we realized a dedicated tool to migrate data accurately and efficiently.
Tech Stack and Development Tools
- Programming Language: PHP 7
- Task Management Tool: Excel
Client Challenges
- Lack of Data Migration Means After Structure Migration
The client was proceeding with a project to migrate their web system’s database infrastructure from Oracle to MariaDB. While the schema structure and environment setup were complete, the actual data migration work remained. Manual methods and existing general-purpose tools could not meet their specific requirements, leaving them without a means to ensure reliable data migration.
- Balancing Rapid Implementation and Reliability
To adhere to the overall system migration schedule, speed was required to move quickly from development to implementation. At the same time, since the tool would handle core data, it needed to possess high reliability, ensuring zero data loss or corruption.
Client Requests
- Support for Complete Migration of All Data
They requested a dedicated tool capable of migrating all data stored in Oracle to MariaDB without any loss. It needed to be more than just a copy; functionality to handle differences in data types and specifications was essential.
- Compatibility with Existing Environment and Maintainability
To lower the barriers to implementation, the tool needed to be easy to use without requiring complex setup. Furthermore, high compatibility with the current backend system was desired, along with a structure that would allow the client’s own team to maintain it in the future.
Our Proposal and Approach
- Development of a Command-Line Tool Using PHP
Considering that the client is an IT company and their current system operates on PHP, we proposed developing a command-line tool (CLI) using PHP. This allowed for the utilization of the existing server environment as is, curbing new infrastructure investment while establishing a system that the client’s engineering team could maintain and operate without difficulty.
- Optimization of Data Mapping Settings
To absorb the specification differences between Oracle and MariaDB, we implemented a mapping function to define the correspondences of tables, columns, and data types in detail. Instead of simple data movement, we incorporated appropriate data conversion processing suited for use at the destination, preventing system errors after migration.
- Ensuring Integrity through Parallel Connection to Oracle and MariaDB
Instead of a sequential process of extracting data from one side, saving it, and then inserting it into the other, we adopted an architecture that connects to both databases simultaneously for parallel processing. This enabled real-time data comparison and verification, realizing both improved migration accuracy and reduced operation time.
- Detailed Logging and Error Control
To enhance the transparency of the migration process, we implemented a logging function that outputs details such as the number of processed records, duration, and any errors generated. By appropriately controlling processing when errors occur and facilitating cause identification, we ensured the safety of the migration work.
- Implementation of Flexible Configuration
We designed specifications that allow flexible setting of variable parameters, such as connection information and target tables, via external files or command-line arguments. This achieved operability that allows for immediate response to environmental changes or scope modifications without the need to alter the program code.