Data platform

Db2 migration: moving off IBM Db2 with both databases in sync until you switch

Move data off IBM Db2 into a modern database, in phases, while Db2 stays in production. Interkey scopes the work and runs it with iblync.

  • Built and supported by Interkey An Interkey product, delivered and supported by Interkey
  • One platform for migration and continuous sync The move and the replication that follows it
  • Written quote after one meeting The price is discussed in a meeting about your systems

A Db2 migration moves data and applications from IBM Db2 to another database, such as PostgreSQL or SQL Server, or copies Db2 data continuously into a newer system. The safe pattern is to load the data, keep Db2 and the target in sync, and switch application by application. Interkey delivers this in Saudi Arabia with iblync.

At a glance

The main facts of a Db2 migration with Interkey
QuestionShort answer
What a Db2 migration isMoving data and applications from IBM Db2 to another database, or copying Db2 data continuously into a newer system
Where the data can goPostgreSQL, SQL Server or MySQL, or another system iblync connects to
Db2 platformsiblync connects to Db2 on LUW, z/OS and IBM i
How the data movesAn initial load, then continuous sync with iblync while Db2 stays in production
Who does the workInterkey: assessment, code rework, data move and cutover, with your database and application teams

Three routes off Db2

Most Db2 projects follow one of three routes. Each one fits a different situation.

01

Full migration to another engine

The data, the schema and the stored code move to PostgreSQL, SQL Server or MySQL, and Db2 is retired once the applications have moved. It fits when the reason to leave is clear and the applications can be changed and tested.

02

Continuous copy, with Db2 staying

iblync keeps a newer system supplied with Db2 data, in one direction, while Db2 stays the system of record. It fits when reporting or a new application needs current Db2 data and the core programs stay where they are. See real-time replication.

03

Stay on Db2 and modernise around it

Db2 stays. The applications and services around it are modernised first, and the database decision is taken later. It fits when Db2 does its job and nobody plans to rewrite the programs that depend on it.

Db2 to PostgreSQL or SQL Server: what needs rework

Six differences that come up on most Db2 sources.

Db2 features, their PostgreSQL and SQL Server counterparts and the work each one needs
In Db2In PostgreSQL and SQL ServerWhat the work is
TIMESTAMP with up to 12 fractional digits, and DECFLOATPostgreSQL timestamp keeps 6 fractional digits and SQL Server datetime2 keeps 7; neither has DECFLOATEach column is mapped by the values it holds. Longer timestamps are rounded, so code that compares them is checked. DECFLOAT usually becomes numeric or decimal.
Columns declared FOR BIT DATA, and text often stored in EBCDIC on z/OS and IBM ibytea in PostgreSQL, varbinary in SQL Server; text in UTF-8 or UnicodeBinary columns move as binary, not as text. Text is converted to the target encoding during the load, and column lengths are checked, because a character can take more bytes after conversion.
Identity columns, and sequences called with NEXT VALUE FORIdentity columns in both; PostgreSQL calls a sequence with nextval('seq'), SQL Server keeps NEXT VALUE FORCalls are rewritten where the target needs it, then each sequence and identity column is set past the highest value loaded.
Stored procedures and functions in SQL PLPL/pgSQL in PostgreSQL, Transact-SQL in SQL ServerThe code is rewritten in the target language and tested against production-shaped data. Error handling and cursors usually need the most care.
Row-level triggers with their code written inside themPostgreSQL: a trigger that calls a separate trigger function. SQL Server: statement-level triggers that read the inserted and deleted tablesEach trigger is rewritten for the target, and row-by-row logic is reviewed where it moves to a statement-level trigger.
SYSIBM.SYSDUMMY1, special registers such as CURRENT TIMESTAMP, and FETCH FIRST n ROWS ONLYA SELECT with no FROM and CURRENT_TIMESTAMP in both; PostgreSQL accepts FETCH FIRST, SQL Server uses TOP or OFFSET with FETCH NEXTThe SQL in the applications and in the stored code is searched for these forms and rewritten.

Each row follows IBM's Db2 documentation and the PostgreSQL and SQL Server documentation. Details differ between Db2 on LUW, z/OS and IBM i, so the assessment checks every row against the release you run.

Db2 on LUW, z/OS and IBM i

IBM Db2 runs on three platforms, and iblync connects to Db2 on all three: Linux, UNIX and Windows (LUW), z/OS on the mainframe, and IBM i. The platform changes the work around the data more than the route.

  • Db2 on LUW runs on the same kinds of servers as the usual targets, so the move is mostly about schema, code and data.
  • Db2 on z/OS and on IBM i often hold text in EBCDIC, and their applications are often COBOL or RPG programs with SQL inside them. Those programs join the scope when the applications move.

The platform and release you run are confirmed in the assessment, together with the target. The full list of sources and targets is on the iblync connectors page.

Keeping Db2 and the target in sync

Db2 keeps serving production through every step until the last application has moved. The two ways of reading changes from a source database are compared in log-based or query-based CDC, and the parallel run is on parallel run and cutover.

  1. Initial load.

    The existing data is copied to the target once, at a limited speed so production on Db2 is not slowed.

  2. Continuous sync with iblync.

    iblync applies every change made in Db2 after the load to the target. If the target is unavailable, changes wait in a queue and are applied when it returns.

  3. Comparison.

    The data in both databases is compared against checks agreed in advance, and each application is tested on the target.

  4. Switch, application by application.

    Each application's connections move to the target in a short pause whose length is agreed in advance. Where a moved application writes data that others still read in Db2, two-way sync keeps both sides in step.

When to stay on Db2

Sometimes the honest answer is to stay. Three cases come up most:

  • Packaged software that its vendor supports only on Db2. Moving the database would leave you on an unsupported system.
  • Core programs on z/OS or IBM i that nobody plans to rewrite. The database can move only when the programs that use it move.
  • No real problem today. If Db2 carries the load and the support suits you, a migration adds risk without a reason.

In these cases the second route, copying Db2 data to a newer system, may give the business what it needs. The assessment says so in writing.

What shapes the work and the timeline

We do not publish a fixed duration for a Db2 migration, because your environment decides it. Four factors shape the work and the timeline:

  • Stored code and application SQL: procedures, triggers, and SQL written for Db2 inside the applications. Usually the largest factor.
  • The platform: LUW, z/OS or IBM i, and with it the encoding and the programs around the database.
  • The data: its volume and how fast it changes.
  • The switch: how many applications move, and the downtime window accepted for each.
Read more

The assessment turns these into a schedule for your project. The price is discussed in a meeting; see iblync pricing to book one. Before you start, the migration checklist helps you gather the details, and each target has its own page: PostgreSQL migration and SQL Server migration.

Questions buyers ask

Can Db2 be migrated to PostgreSQL?

Yes, as a project in two parts. The schema and the stored code are rewritten for PostgreSQL, with SQL PL becoming PL/pgSQL. The data is loaded and then kept in sync by iblync until the switch, so Db2 stays in production meanwhile. The wider route is on our PostgreSQL migration page.

Can Db2 be migrated to SQL Server?

Yes, in the same two parts. SQL PL is rewritten in Transact-SQL, row-level triggers are reworked for SQL Server's statement-level triggers, and some types are mapped again. The data moves with an initial load and continuous sync, and applications switch one at a time. See our SQL Server migration page.

Does iblync connect to IBM Db2?

Yes. IBM Db2 is one of the systems iblync connects to, as a source or a target, on LUW, z/OS and IBM i. The platform and release you run, and the target you choose, are confirmed in the assessment. The full list of sources and targets is on the iblync connectors page.

Can Db2 stay live during the migration?

Yes, through the initial load and the continuous sync. A short pause remains when each application's connections switch to the target, and its length is agreed with you in advance. Because applications can move one at a time, Db2 keeps serving the ones that have not moved yet.

Can we copy Db2 data to a new system without retiring Db2?

Yes. iblync keeps the new system supplied with Db2 data through continuous one-way sync, while Db2 stays the system of record for the programs that use it. This suits reporting and new applications that need current data. Our real-time replication page explains how it runs.

How is a Db2 migration priced?

The price is discussed in a meeting about your systems and followed by a written quote, which you can book on the iblync pricing page.

Next step

Scope a Db2 migration

Tell us the Db2 platform (LUW, z/OS or IBM i), roughly how many stored procedures and triggers it holds, the data volume, the target, and the downtime window you can accept.

Required field

By sending this form, you agree to our Privacy Notice.

What happens next

  1. We read your request
  2. An engineer contacts you
  3. You get an estimate or a demo
  • Built and supported by Interkey

    An Interkey product, delivered and supported by Interkey

  • One platform for migration and continuous sync

    The move and the replication that follows it

  • Written quote after one meeting

    The price is discussed in a meeting about your systems

Or directly

+966-11-2180999 [email protected]

Tawuniya Towers, North Tower, 7th Floor, King Fahad Highway, Olaya, P.O. Box 56835, Riyadh 11564, Saudi Arabia

or Read the migration checklist

Published by Interkey. Last updated . Interkey is registered in Riyadh, Saudi Arabia under commercial registration 1010156897.