This chapter covers the strategies, tools, and best practices for migrating mainframe workloads to Microsoft Azure. Mainframe migration is a niche but critical topic for the AZ-305 exam, typically appearing in 2-3% of questions, often in the context of designing migration strategies for legacy systems. You will learn the key approaches—rehost, replatform, refactor, and replace—and the specific Azure services that enable each, such as Azure Virtual Machines, Azure Logic Apps, and Azure Cosmos DB. Understanding mainframe migration is essential for architects designing cloud solutions for large enterprises with legacy infrastructure.
Jump to a section
Imagine a large factory that has been running for decades, with specialized machinery, conveyor belts, and a skilled workforce. The factory must move to a new building across town. You cannot just pick up the entire factory at once; you must plan the move carefully to avoid stopping production. First, you inventory all machinery and processes, identifying which machines can be moved as-is (like mainframe applications that can be rehosted), which need to be replaced with newer models (like refactoring), and which are obsolete and can be discarded. You then set up a temporary parallel operation: the new building starts running some processes while the old factory continues others, gradually shifting load. You must ensure the new building has the same power, network, and cooling capabilities (like Azure landing zone). The move involves disassembling large machines (mainframe decommissioning), transporting them (data migration), and reassembling with adjustments (application integration). The goal is to minimize downtime and ensure the new factory runs as efficiently as the old one, with all safety and compliance measures met. This mirrors mainframe migration: assess, plan, execute in phases, validate, and decommission.
What is Mainframe Migration and Why Does It Exist?
Mainframe migration refers to the process of moving applications, data, and workloads from legacy mainframe systems (e.g., IBM z/OS, Unisys) to cloud infrastructure, specifically Microsoft Azure. Mainframes have been the backbone of large enterprises for decades, running critical applications like batch processing, transaction processing (CICS, IMS), and database management (DB2, IMS DB). However, they are expensive to maintain, require specialized skills, and lack the agility of cloud platforms. Azure offers a way to modernize these workloads, reduce costs, and enable innovation. The AZ-305 exam focuses on your ability to recommend appropriate migration strategies and Azure services based on business requirements.
How Mainframe Migration Works Internally
Mainframe migration is not a single action but a phased process involving assessment, planning, migration, testing, and cutover. The core mechanisms involve:
Assessment: Use tools like Azure Migrate to discover mainframe assets, dependencies, and performance metrics. This includes analyzing CPU usage, memory, I/O patterns, and batch job schedules. The assessment produces a dependency map and a migration plan.
Rehost (Lift and Shift): Move applications to Azure VMs running mainframe-emulated operating systems or recompile COBOL/CICS applications to run on Windows/Linux. This preserves the existing code but moves the infrastructure. Tools: Azure Migrate, Azure Site Recovery for replication.
Replatform: Modify the application slightly to use Azure PaaS services. For example, replace mainframe DB2 with Azure SQL Database or replace CICS transaction management with Azure Logic Apps or Service Fabric. This reduces operational overhead but requires some code changes.
Refactor (Re-architect): Rewrite applications to use cloud-native architectures like microservices, serverless, and containers. This is the most transformative but also most costly and time-consuming.
Replace: Switch to SaaS solutions like Dynamics 365 or third-party ERP systems, eliminating the mainframe entirely.
Key Components, Values, and Defaults
Azure Migrate: The primary assessment tool. It supports discovery of VMware, Hyper-V, and physical servers, but for mainframes, it relies on third-party tools like Micro Focus or Raincode. Default assessment settings: run for 30 days to collect performance data, but you can adjust to 1 week or 3 months.
Azure Site Recovery: For replication of mainframe VMs to Azure. Default replication policy: 15-second recovery point objective (RPO) for high priority, 5-minute for low priority.
Azure Database Migration Service: For migrating DB2 to Azure SQL Database or Azure Cosmos DB. Supports offline (bulk copy) and online (continuous sync) modes. Default online mode: 10-second replication latency.
Azure Logic Apps: Can replace CICS/IMS transaction processing. Logic Apps triggers can poll for batch jobs or respond to HTTP requests. Default timeout for a workflow: 1 year, but individual actions have 120-second timeout by default.
Azure Batch: For mainframe batch job processing. Azure Batch can schedule and run parallel workloads on a pool of VMs. Default pool size: 3 nodes, but you can scale to thousands.
Mainframe Emulators: Products like Micro Focus Enterprise Server or TMAXSoft OpenFrame run mainframe applications on Windows/Linux. They emulate JCL, CICS, IMS, and DB2 interfaces. Licensing is typically per CPU core.
Configuration and Verification Commands
For Azure Migrate assessment:
# Create a project
az migrate project create --name MyProject --resource-group MyRG --location eastus
# Add a discovery tool (appliance)
az migrate appliance create --name MyAppliance --project MyProject --resource-group MyRG
# Start discovery
az migrate discovery start --appliance-name MyAppliance --resource-group MyRGFor Azure Site Recovery replication:
# Enable replication for a VM
az site-recovery protected-item create --fabric-name MyFabric --protection-container MyContainer --name MyVM --policy-name MyPolicy --resource-group MyRG --vault-name MyVault
# Verify replication health
az site-recovery job list --resource-group MyRG --vault-name MyVault --query "[?contains(displayName, 'Replication')].{Job:displayName, Status:status}"How It Interacts with Related Technologies
Mainframe migration interacts with: - Azure Networking: Required for connectivity between on-premises and Azure. ExpressRoute or VPN gateway is used for initial data transfer and ongoing replication. Latency must be low (<10 ms RTT) for real-time transaction migration. - Azure Active Directory: For identity and access management. Mainframe RACF or ACF2 security must be mapped to Azure AD roles and groups. This is often the most complex part due to mainframe security models. - Azure Policy and Blueprints: To enforce compliance and governance in the target Azure environment. Mainframe workloads often have strict regulatory requirements (e.g., PCI-DSS, HIPAA). - Azure Cost Management: To track and optimize costs. Mainframe migrations typically reduce TCO by 30-50%, but careful monitoring is needed to avoid overspending on oversized VMs. - Azure DevOps: For CI/CD pipelines when refactoring applications. Mainframe code is often stored in PDS (Partitioned Data Sets) and must be migrated to Git-based repositories.
Step-by-Step Migration Process
Assessment and Discovery: Use Azure Migrate with a mainframe-specific discovery tool (e.g., Micro Focus Discovery). Collect inventory of all CICS regions, IMS databases, batch jobs, and dependencies. This typically takes 2-4 weeks.
Target Architecture Design: Design the Azure landing zone, including network topology, identity, and security. Decide on migration strategy for each application: rehost, replatform, refactor, or replace. Create a dependency map.
Proof of Concept (PoC): Migrate a non-critical application to validate the approach. Set up an Azure environment, migrate data, and test functionality. This identifies issues early.
Data Migration: Move mainframe databases (DB2, IMS) to Azure using Azure Database Migration Service or third-party tools like Attunity. For large datasets (TB range), use offline data transfer with Azure Data Box. For online migration, use continuous sync.
Application Migration: Rehost applications to Azure VMs with emulators, or replatform/refactor as appropriate. Use Azure DevOps for deployment. Test batch jobs and transaction flows.
Integration and Testing: Connect migrated applications to remaining mainframe systems via Azure Integration Services (Logic Apps, Service Bus). Perform end-to-end testing, including performance and security testing.
Cutover and Decommissioning: Switch production traffic to Azure. This is often done in phases (e.g., first migrate batch jobs, then online transactions). Monitor for issues. After stabilization, decommission the mainframe.
Common Pitfalls
Underestimating Complexity: Mainframe applications often have undocumented dependencies and decades of accumulated technical debt. Always perform a thorough assessment.
Ignoring Security: Mainframe security models (RACF, Top Secret) are granular. Failing to map to Azure AD can lead to access control gaps.
Network Latency: Real-time transaction systems require low latency. If the mainframe is in a different region, consider using Azure Proximity Placement Groups or ExpressRoute with local peering.
Batch Job Scheduling: Mainframe batch jobs are tightly coupled with JCL and dependencies. Azure Batch or third-party schedulers like BMC Control-M must replicate this complexity.
Exam Focus Summary
For AZ-305, focus on:
The four migration strategies (rehost, replatform, refactor, replace) and when to use each.
Azure Migrate as the assessment tool, but know that mainframe discovery requires third-party extensions.
Azure Site Recovery for rehost, Azure Database Migration Service for database replatforming.
Azure Logic Apps and Azure Batch as replacements for CICS/IMS and batch processing.
Cost and performance considerations: mainframe migrations typically reduce TCO but require careful sizing of Azure VMs.
Assessment and Discovery
Use Azure Migrate with a mainframe-specific discovery tool (e.g., Micro Focus Enterprise Analyzer) to inventory all mainframe assets: CICS regions, IMS databases, batch jobs, JCL, and dependencies. Collect performance metrics like CPU usage, memory, and I/O over a period of at least 30 days. This step produces a dependency map and a migration plan. The tool identifies which applications are tightly coupled and which can be migrated independently. Key outputs: list of application components, data volumes, transaction rates, and batch job schedules.
Design Target Architecture
Design the Azure landing zone: define subscription structure, networking (VNet, subnets, ExpressRoute), identity (Azure AD synchronization), and security (Azure Policy, RBAC). For each mainframe application, decide on migration strategy: rehost (Azure VMs with emulator), replatform (e.g., DB2 to Azure SQL), refactor (microservices), or replace (SaaS). Create a high-level architecture diagram showing how applications connect to each other and to on-premises systems during the migration phase.
Proof of Concept
Select a non-critical, low-complexity application to migrate first. Set up an Azure environment mirroring the target architecture. Migrate the application and its data using chosen tools (e.g., Azure Site Recovery for rehost, Azure DMS for database). Test functionality, performance, and integration. This validates the migration approach, identifies issues (e.g., missing dependencies, performance bottlenecks), and builds team confidence. Iterate on the process based on lessons learned.
Data Migration
Migrate mainframe databases (DB2, IMS) to Azure. For small to medium datasets (<1 TB), use Azure Database Migration Service in online mode with continuous sync. For large datasets, use Azure Data Box for offline transfer. For IMS, use third-party tools like Attunity. Ensure data integrity by comparing row counts and checksums. For batch job data, transfer flat files to Azure Blob Storage. This step may run in parallel with application migration.
Application Migration and Cutover
Migrate applications according to the chosen strategy. For rehost, deploy Azure VMs with mainframe emulators (e.g., Micro Focus Enterprise Server) and migrate COBOL/CICS code. For replatform, modify code to use Azure PaaS services. Use Azure DevOps for deployment and testing. After successful testing, perform cutover: redirect traffic from mainframe to Azure. This is often done in phases (e.g., batch jobs first, then online transactions). Monitor performance and roll back if issues arise. Finally, decommission the mainframe.
Scenario 1: Large Bank Migrating Core Banking from IBM z/OS
A major bank with a 30-year-old IBM z/OS mainframe running CICS and DB2 for core banking transactions wanted to move to Azure to reduce costs and enable digital innovation. They chose a rehost strategy for the first phase, using Micro Focus Enterprise Server on Azure VMs. They used Azure Migrate for assessment, discovering over 500 CICS programs and 2000 batch jobs. The migration took 18 months, with a PoC on a non-critical loan application. Data migration used Azure DMS for DB2 to Azure SQL Database. The biggest challenge was mapping mainframe RACF security to Azure AD RBAC, requiring custom scripts. The result was a 40% cost reduction and ability to deploy new features in weeks instead of months.
Scenario 2: Insurance Company Replatforming Policy Administration
A large insurer running IMS DB and COBOL applications on a mainframe wanted to modernize. They chose replatforming: replace IMS with Azure Cosmos DB for flexible schema, and use Azure Logic Apps to replace CICS transaction processing. Assessment showed 80% of transactions were simple CRUD operations. They rewrote COBOL code to C# and deployed as Azure Functions. The migration used Azure DevOps for CI/CD and Azure DMS for initial data load. Performance testing showed Azure could handle peak loads of 10,000 transactions per second with auto-scaling. The project took 12 months, with 60% cost savings and improved disaster recovery.
Scenario 3: Retailer Replacing Mainframe with SaaS
A retail chain with a mainframe running inventory management decided to replace it with a SaaS solution (Microsoft Dynamics 365 Supply Chain Management). This eliminated the need for any mainframe migration of applications. They only needed to migrate historical data to Azure SQL Database for reporting. They used Azure Data Factory to extract, transform, and load data from mainframe files (VSAM) to Azure. The project was completed in 6 months, with the mainframe decommissioned. The key challenge was data format conversion from EBCDIC to ASCII. They used Azure Logic Apps to handle real-time inventory updates during cutover.
What AZ-305 Tests on Mainframe Migration
AZ-305 objective 4.3: 'Recommend a migration strategy for mainframe workloads.' The exam expects you to differentiate between rehost, replatform, refactor, and replace. You must know which Azure services support each strategy. Common question patterns:
Given a business requirement (e.g., minimize cost, minimize change, improve agility), recommend the appropriate strategy.
Given a mainframe component (e.g., CICS, DB2, batch jobs), recommend the Azure replacement.
Identify the correct assessment tool (Azure Migrate) and know it requires third-party tools for mainframes.
Most Common Wrong Answers and Why
Choosing 'Rehost' when 'Refactor' is better: Candidates often pick rehost because it's fastest, but the question may emphasize 'improve scalability' or 'reduce operational overhead' — refactor better meets these. Trap: The exam asks for 'best' recommendation, not just 'possible'.
Selecting Azure SQL Database for all database migrations: Mainframe databases include IMS (hierarchical) and VSAM (file-based). Azure SQL is for relational DB2. For IMS, use Cosmos DB or third-party tools. Candidates forget IMS is not relational.
Recommending Azure Site Recovery for all rehost scenarios: ASR is for VM replication, but mainframe rehost may use emulators on VMs. However, ASR does not support mainframe OS directly; it replicates the VM running the emulator. Candidates may think ASR can replicate the mainframe OS itself, which is false.
Ignoring batch jobs: Mainframe batch processing is critical. Candidates often focus on online transactions and forget to plan for batch. The exam may present a scenario with heavy batch processing; the correct answer might involve Azure Batch or third-party schedulers.
Specific Numbers and Terms
Azure Migrate assessment period: default 30 days, can be 1 week or 3 months.
Azure Site Recovery RPO: 15 seconds for high priority, 5 minutes for low.
Azure DMS online mode: 10-second replication latency.
Key terms: CICS, IMS, DB2, JCL, COBOL, VSAM, RACF.
Emulators: Micro Focus Enterprise Server, TMAXSoft OpenFrame.
Edge Cases and Exceptions
Mainframe applications with no source code: cannot refactor or replatform; only rehost or replace.
Real-time transaction systems with sub-second latency: must use rehost with emulators on VMs in the same region, with ExpressRoute. Refactoring may introduce latency.
Regulatory compliance: some industries (e.g., healthcare) require data to stay in-country. Azure regions must match.
Mainframe is still needed for some applications: hybrid migration is common. Azure Logic Apps can bridge old and new systems.
How to Eliminate Wrong Answers
If the question says 'minimize changes to code,' eliminate refactor and replace (both require code changes). Rehost or replatform are correct.
If the question says 'improve agility and scalability,' eliminate rehost (still uses monolithic code). Refactor or replatform are better.
If the question mentions 'batch jobs,' look for Azure Batch, Logic Apps with schedule triggers, or third-party scheduler. If no batch consideration, it's a trap.
If the question mentions 'IMS database,' eliminate Azure SQL Database, recommend Cosmos DB or third-party.
Four migration strategies: rehost, replatform, refactor, replace. Choose based on business goals (cost, agility, risk).
Azure Migrate is the assessment tool but requires third-party extensions for mainframe discovery.
For rehost, use Azure VMs with mainframe emulators like Micro Focus Enterprise Server.
For database migration, use Azure DMS for DB2 to Azure SQL, and third-party tools for IMS or VSAM.
For batch job migration, use Azure Batch or Logic Apps with schedule triggers.
Security mapping from mainframe RACF to Azure AD is a critical step often underestimated.
Mainframe migration is typically phased, with hybrid operations lasting months or years.
Network latency (<10 ms RTT) is crucial for real-time transaction migration.
Proof of concept on a non-critical application is essential before full migration.
Expect exam questions to test strategy selection based on specific requirements like 'minimize change' vs 'maximize agility'.
These come up on the exam all the time. Here's how to tell them apart.
Rehost (Lift and Shift)
No code changes required; fastest migration.
Uses Azure VMs with mainframe emulators.
Minimal risk but does not improve agility.
Cost savings from moving off mainframe hardware.
Limited to 30-40% TCO reduction.
Refactor (Re-architect)
Code rewritten to cloud-native (microservices, serverless).
Maximum agility and scalability.
Highest cost and time investment.
Enables DevOps and CI/CD pipelines.
Can reduce TCO by 50-70%.
Mistake
Azure Migrate can discover mainframe workloads natively.
Correct
Azure Migrate does not natively support mainframe discovery. It requires third-party tools like Micro Focus Enterprise Analyzer or Raincode to collect inventory and dependencies from mainframe systems.
Mistake
Rehosting a mainframe application to Azure VMs requires no changes to the application.
Correct
While rehosting preserves the code, you may need to change configuration files, network settings, and security integration. For example, mainframe JCL may reference dataset names that need mapping to Azure file shares.
Mistake
Azure Site Recovery can directly replicate a mainframe OS.
Correct
Azure Site Recovery replicates VMs running supported OS (Windows, Linux). It cannot replicate the mainframe OS (z/OS). To use ASR, you must first move the mainframe workload to a VM running an emulator, then replicate that VM.
Mistake
Mainframe databases are all relational, so Azure SQL Database is always the target.
Correct
Mainframe databases include hierarchical (IMS), network (IDMS), and file-based (VSAM). Only DB2 is relational. For IMS, use Azure Cosmos DB; for VSAM, use Azure SQL or Blob Storage depending on access patterns.
Mistake
Mainframe migration is a single project with a clear end date.
Correct
Mainframe migration is often phased over months or years, with hybrid operations. Many enterprises run mainframe and Azure in parallel for years. The exam expects you to plan for cutover phases and rollback plans.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
Rehost (lift and shift) moves the application as-is to Azure VMs running a mainframe emulator, with no code changes. Replatform makes minor modifications to use Azure PaaS services, such as replacing DB2 with Azure SQL Database or CICS with Azure Logic Apps. Replatform reduces operational overhead but requires some code changes, while rehost is faster but retains more legacy complexity.
Azure Site Recovery can be used only after the mainframe workload is running on a VM (e.g., Windows Server with Micro Focus emulator). It cannot directly replicate the mainframe OS (z/OS). You must first rehost the application to a VM, then use ASR for replication and disaster recovery.
Azure Logic Apps can replace CICS by orchestrating transactions via HTTP triggers, queues, and scheduled tasks. For high-throughput, consider Azure Service Fabric or Azure Functions. The choice depends on transaction complexity and volume.
Mainframe batch jobs (JCL) can be migrated using Azure Batch, which runs parallel workloads on a pool of VMs. Alternatively, use Azure Logic Apps with schedule triggers or third-party schedulers like BMC Control-M. You need to convert JCL to PowerShell or Python scripts.
The default assessment period is 30 days. You can configure it to 1 week or 3 months. For mainframe migration, 30 days is recommended to capture full batch cycles.
No, IMS is a hierarchical database, not relational. Azure SQL Database is for relational data. For IMS, consider Azure Cosmos DB (NoSQL) or third-party tools that convert IMS to relational. Alternatively, use an IMS emulator that supports SQL access.
Mainframe migration typically reduces total cost of ownership (TCO) by 30-50% by eliminating hardware maintenance, software licensing, and specialized personnel. Azure also offers pay-as-you-go pricing and auto-scaling, further optimizing costs.
You've just covered Mainframe Migration to Azure — now see how well it sticks with free AZ-305 practice questions. Full explanations included, no account needed.
Done with this chapter?