Skip to content
Qzentra

Case fileData Engineering

5 TB Zero-Downtime MySQL Migration

A 24/7 production system on legacy MySQL 5.7 with roughly 5 TB of data, moved to a modern MySQL environment by replication with no service interruption at cutover.

5 TBof production data moved with zero service interruption

  • MySQL
  • replication
  • migration
  • SQL optimization
  • high availability

Layer coverage

  1. Data: worked in this layer
  2. Infrastructure: worked in this layer
  3. APIs: not part of this system
  4. AI: not part of this system
  5. Automation: not part of this system
  6. Application: not part of this system
Enters through
Data Engineering
System
Production database migration

The challenge

A production database of approximately 5 TB was running on legacy MySQL 5.7 under a 24/7 workload. It had to move to a modern MySQL environment, and there was no maintenance window in which the system could stop.

A migration of that size cannot be a dump and restore. Data keeps changing during the copy, the newer MySQL version rejects configuration the old one accepted, and the moment of cutover is the moment the business is exposed.

What made it non-trivial

  • Approximately 5 TB of data that kept changing under a 24/7 workload
  • No maintenance window: zero service interruption was the requirement
  • Deprecated variables and compatibility differences between MySQL 5.7 and the target
  • A single cutover moment with the whole system depending on it

What Qzentra engineered

Qzentra planned and ran a replication-based migration. The MySQL 5.7 workload was audited for compatibility with the target environment, and deprecated variables were remediated before any data moved.

A replica was built on the modern environment and synchronized with the live source while it continued to serve traffic. At cutover the replica was promoted, with no service interruption. Afterwards, queries were modernized using common table expressions.

What Qzentra was responsible for

  • Migration planning and production risk management
  • Compatibility audit and deprecated-variable remediation
  • Replica build and synchronization
  • Promotion at cutover
  • Post-migration query modernization with CTEs

How the system works

Five steps, all in the two foundation layers. Nothing above Infrastructure was touched, and nothing needed to be.

  1. Compatibility audit of MySQL 5.7 workload

    Data

    The existing workload was audited against the target MySQL environment before anything moved, to find what would break.

  2. Deprecated variable remediation

    Infrastructure

    Configuration variables deprecated in the target version were remediated on the source side, so the target would accept the workload.

  3. Replica build and synchronization

    Infrastructure

    A replica was built on the modern environment and kept synchronized with the live source, which continued to serve traffic.

  4. Replica promotion at cutover

    Infrastructure

    Cutover was the promotion of the synchronized replica to primary. There was no service interruption.

  5. Query modernization with CTEs

    Data

    After the migration, queries were modernized using common table expressions, as a separate step from the cutover.

The migration drawn as two stores and one switch.The legacy source serves from the left while the replica is built and kept synchronized on the right. The cutover at the centre is the one controlled step; after it, the replica serves.

Engineering decisions

  1. Replication, not dump and restore

    With roughly 5 TB changing under a 24/7 workload, the way to move without stopping is to build a replica and keep it synchronized until the switch.

  2. Compatibility first

    The 5.7 workload was audited against the target before migration and deprecated variables were remediated, so incompatibilities were found in the audit rather than at cutover.

  3. Cutover as promotion

    Cutover was the promotion of an already synchronized replica. That reduces the switch to a controlled step rather than a data move.

  4. Modernize after, as a separate step

    Query modernization with CTEs was done after the migration, not folded into the cutover.

What was achieved

  • Zero service interruption at cutover
  • Approximately 5 TB of production data migrated from MySQL 5.7 to a modern MySQL environment
  • Compatibility issues and deprecated variables remediated before cutover
  • Queries modernized with CTEs after migration

Technology, after the architecture

Named last, with the role each played. The capabilities are what the project demonstrates beyond its primary service.

  • MySQL 5.7Source environment, 24/7 production
  • MySQL, modern environmentTarget environment
  • MySQL replicationReplica build, synchronization, and promotion
  • SQL and CTEsPost-migration query modernization

Capabilities demonstrated

  • database architecture
  • migration planning
  • MySQL replication
  • compatibility assessment
  • SQL optimization
  • production risk management
  • high-availability thinking

Discuss a project

Running a production database you cannot afford to stop?

Tell us the version, the size, the workload, and what it has to move to. Migrations are planned from the risk backwards.