Generic Algorithms of Database Migration

Generic Algorithms of Database Migration

Following the modern trend of replacement proprietary software by open-source equivalents, many companies and organizations come to the idea of database migration. Database migration refers tomoving data, meta-objects, stored procedures, functions, and triggers from the source database management system to the target. Usually database migration implies necessary changes to the applications, types mapping and SQL conversion.

The database migration involves such important steps as assessment, preparing, selecting, extracting, transforming data concerning the differences between the source and target DBMSand validation of the resulting database. Those phases can be difficult and time-consuming because it requires translating entries and logic between two systems having different data types and SQL syntax. Database migration is done for several reasons, including cost, customization, and flexibility.

The first phase in planning a database migration involves assessing the application to determine the feasibility of moving it from the source DBMS to the target. This phase requires a comprehensive analysis of technology-related issues, including evaluating the compatibility of the client, application server, data access, and database features. Check that software of the database application layer is certified for the destination database management system. Otherwise, either persuade the vendor to add support for the new DBMS or usecompatible application with similar capacities.

Next step is to validate prerequisites on the target system before initiating data migration, such as server resources, operating system, and the installation and configuration of data migration software and related drivers. Resources of the destination database server or cluster of servers mustbe powerful and scalable enough to handle the volume and complexity of database being received.

After validating prerequisitesand capabilities of the target system, it is time to identify any discrepancies in schema, data formatting and SQL features between the source and destination DBMS. Addressing these differences before the data migration prevents potential errors that can be frustrating and time-consuming. Running performance tests is extremely important step of the database migration phase as variations in the functionality of built-in transactions or features of the source database may arise when transitioning to the target platform, potentially affecting the application.

Data Migration

There are several approaches and tools available in the market for data migration, with most of them being based on three primary methods: snapshot, parallel snapshot, and change data capture (CDC). The snapshot method involves taking a snapshot of the source database and applying it to the target database, with data being moved from the source DBMS to the target all at once, and WRITE operations being restricted on the source database during the snapshot process. In contrast, the parallel snapshot splits the data into fragments and takes snapshots simultaneously, significantly reducing the snapshot duration and downtime window, though it still persists.

CDC software is employed to monitor and record real-time changes from the source database, which are then applied to the target database. Two change data capture techniques are trigger-based and transaction log. Unlike snapshot and parallel snapshot methods, which may result in data loss or duplication and incur significant overhead in the DBMS work due to bulk data reading, CDC approaches require either the modification of the source database (trigger-based) or rely on the undocumented and changeable format of the transaction log.


In summary, database migration is a complex and critical process that requires careful planning and execution. It involves transferring important elements such as data, meta-objects, stored procedures, functions, and triggers from one DBMS to another while ensuring that necessary changes are made to the application. Before initiating data migration, it is crucial to assess the compatibility of the application with the target DBMS, identify discrepancies in schema and data formatting between the source and target DBMS, and perform performance testing.

There are different approaches and tools available for data migration, and each has its pros and cons. The snapshot and parallel snapshot methods involve taking a snapshot of the source database state and applying it to the target database. This approach has some drawbacks, including downtime and essential overhead in the DBMS work due to bulk reading the data. On the other hand, CDC approaches track and capture changes in real-time, either by using trigger-based or transaction log techniques. However, CDC approaches require modification of the source database or rely on the undocumented and changeable format of transaction log.

Choosing the right approach for data migration is critical to the success of the project. It is essential to assess the specific needs of the project and select the most appropriate method. By carefully planning and executing the database migration process, businesses can benefit from cost savings, customization, and flexibility.