Subchapter 72.12
references/migration.mdMarkdown8 KBView on GitHub
| Strategy | Source OS | Method | Downtime |
|---|---|---|---|
| Rehost | Linux (LE) | Db2 backup/restore or Db2MT | Offline: full downtime; Online: minimal |
| Replatform | AIX, Windows, z/OS, zLinux | Db2MT + DMS or Q Replication | Near-zero with replication |
Rehost (Linux → Linux): Faster, no data conversion. Use Db2 native backup/restore or Db2MT. Replatform (AIX/Windows/z/OS → Linux): Requires data conversion. Use Db2MT for metadata + data, then DMS or Q Replication for CDC.
Run before the final backup. Catches blocking issues early.
# Direct (local)
curl -sL https://bit.ly/precheckdb2migration | bash
# Download + run
curl -sL https://bit.ly/precheckdb2migration -o db2_migration_prereq_check.sh
chmod +x db2_migration_prereq_check.sh
./db2_migration_prereq_check.sh
# Remote (from Db2 client)
export DB2USER=<db2-user> DB2PASSWORD=<db2-password> DBNAME=<db-name>
./db2_migration_prereq_check.sh --verbose
# Non-interactive (CI/CD)
DB2_INSTANCES=db2inst1 ./db2_migration_prereq_check.sh| Check | Common failure / fix |
|---|---|
db2updv115 | Must be run on source DB before backup — most common restore failure |
| InDoubt transactions | db2 list indoubt transactions with prompting |
| Invalid objects | db2 "call SYSPROC.ADMIN_REVALIDATE_DB_OBJECTS()" |
| Tablespace state | All must be Normal |
| Non-fenced routines | Convert all to fenced — non-fenced not permitted in RDS |
| Automatic storage | At least one storage group must exist |
| Database config | Backup/rollforward/restore/upgrade pending must all be No |
| Log files | Circular ≤254, archive ≤4096 |
Take a multi-part backup (parallel streams improve S3 restore performance):
db2 backup database <DBNAME> to /backup, /backup, /backup, /backup, /backup
# Produces .001 .002 .003 .004 .005 partsCopy to S3 (create storage alias first):
# On EC2 with IAM role — no credentials needed:
db2 "CATALOG STORAGE ACCESS ALIAS db2S3 VENDOR S3 SERVER https://s3.<region>.amazonaws.com CONTAINER <bucket> DBUSER <masterUser>"
# Self-managed Db2 with long-term credentials:
db2 "CATALOG STORAGE ACCESS ALIAS db2S3 VENDOR S3 SERVER s3.<region>.amazonaws.com USER $AWS_ACCESS_KEY_ID PASSWORD $AWS_SECRET_ACCESS_KEY CONTAINER <bucket> DBUSER <masterUser>"
# Backup directly to S3:
db2 backup database <DBNAME> to DB2REMOTE://db2S3, DB2REMOTE://db2S3, DB2REMOTE://db2S3, DB2REMOTE://db2S3, DB2REMOTE://db2S3Restore on RDS for Db2:
call rdsadmin.restore_database('<DBNAME>', 'OFFLINE', '<s3-prefix>', '<bucket>', '<region>');The s3_prefix is the common part of the backup image filenames excluding .001, .002, etc.
call rdsadmin.set_configuration('RESTORE_DATABASE_NUM_BUFFERS', '100');
call rdsadmin.set_configuration('RESTORE_DATABASE_PARALLELISM', '10');
call rdsadmin.set_configuration('RESTORE_DATABASE_NUM_MULTI_PATHS', '5');
call rdsadmin.set_configuration('USE_STREAMING_RESTORE', 'TRUE');Take online backup to S3 (same as above but backup_type = 'ONLINE')
Restore on RDS:
call rdsadmin.restore_database('<DBNAME>', 'ONLINE', '<s3-prefix>', '<bucket>', '<region>');Copy archive logs to S3 and apply:
call rdsadmin.rollforward_database('<DBNAME>', '<log-s3-prefix>', '<bucket>', '<region>');Repeat step 3 until all logs applied, then complete:
call rdsadmin.complete_rollforward('<DBNAME>');Set up EC2 with IBM MQ, Db2 client, and IIDR Q Replication
Catalog source and target databases with different aliases
Create MQ queues (RESTARTQ, ADMINQ, DATAQ1 with MAXDEPTH=99999999)
Create Q Replication control tables on RDS (requires RDSADMIN stored procedures for tablespaces):
call rdsadmin.create_bufferpool('<DBNAME>', 'BPQASN', 10000, 'Y', 'Y', 8192);
call rdsadmin.create_tablespace('<DBNAME>', 'QAQASN', 'BPQASN', 8192);Create subscriptions with HAS LOAD PHASE N (Db2MT handles the load)
Start Capture and Apply to verify subscriptions activate
Record the start time of earliest in-flight transaction
Run Db2MT for initial data load to S3 → RDS
Restart Q Capture from before the Db2MT start time to catch up changes
Monitor QASN.IBMQREP_APPLYMON.OLDEST_TRANS — when it approaches current time, cutover
SELECT MONITOR_TIME, END2END_LATENCY, ROWS_APPLIED, OLDEST_TRANS
FROM QASN.IBMQREP_APPLYMON
ORDER BY MONITOR_TIME DESC FETCH FIRST 20 ROWS ONLY WITH UR;Use Db2 backup/restore via Db2MT or rdsadmin.restore_database. Fastest path when source is Linux LE.
Online restore + rollforward:
rdsadmin.rollforward_databaserdsadmin.complete_rollforwardAlternative: Q Replication for continuous sync with a brief cutover window.
Use AWS Mainframe Modernization Data Replication with Precisely (from AWS Marketplace): IBM i source, RDS for Db2 target, initial load + CDC. Initial load uses inserts; pre-load large tables via Db2 federation or export/import, then start CDC from a timestamp.
Db2MT for metadata extraction and data unload to S3, then load into RDS. For near-zero downtime add Q Replication for CDC — see the Q Replication section above.
mainframe-migration.md. DMS (full load) or Qlik/Precisely/Q Replication (CDC).