Skip to main content

Self-Managed MySQL to GCP Cloud SQL MySQL Migration | NineData

Migrating self-managed MySQL to GCP Cloud SQL for MySQL is usually not just a copy operation. You need to move existing data, keep new writes synchronized, validate the target data, and cut over application traffic with as little downtime as possible.

NineData Data Replication helps you run the migration in phases: register the source and target data sources, create a replication task, run full migration and incremental synchronization, validate the target, and monitor the task until cutover.

When to use this workflow

Use this workflow when you need to:

  • Move a self-managed MySQL database to GCP Cloud SQL for MySQL.
  • Keep the source database online during migration.
  • Avoid exposing the database through an unnecessary public endpoint by using a private network path or a gateway where applicable.
  • Validate target data before switching application traffic.
  • Keep the replication link running for a period after migration while you complete application verification.

What NineData handles

NineData is designed to reduce the operational work in cross-cloud migration:

  • Private connectivity: Connect to databases through supported private network paths or gateways.
  • Full and incremental migration: Move existing data first, then continue synchronizing source-side changes.
  • Cutover visibility: Use synchronization delay and task details to decide when the target is ready.
  • Data validation: Use data comparison to verify consistency between the source and target.
  • Operational monitoring: Configure alerts for task failures and replication delay.

Before you begin

Prepare the following items:

  • Access to the NineData console.
  • Connection information and accounts for the self-managed MySQL source and GCP Cloud SQL for MySQL target.
  • Network connectivity from NineData to both databases.
  • Required database permissions for creating data sources and running replication tasks.
  • A cutover plan that defines the validation window, application switch time, and rollback criteria.

Step 1: Add the source and target data sources

  1. In the NineData console, click Data Source Management > Data Source, and then click Create Data Source.

    Create a data source in NineData

  2. Follow the page prompts to add the source MySQL database through private network connectivity or the connectivity method that matches your environment.

    Configure private network access for the data source

  3. Repeat the same process for the GCP Cloud SQL for MySQL target.

Step 2: Create the migration task

  1. In the NineData console, click Data Replication > Data Replication, and then click Create Replication.

    Create a replication task

  2. Configure the source and target data sources.

  3. For Replication Type, select the options required for migration:

    • Structure Replication to create compatible target structures.
    • Full Replication to migrate existing rows.
    • Incremental Replication to keep new source-side changes synchronized after the full load.

    Select structure, full, and incremental replication

  4. Complete object selection, mapping, precheck, and task startup.

  5. Monitor the task until the full migration finishes and incremental delay reaches 0 seconds.

    Monitor migration delay

Step 3: Validate target data

Use data comparison before cutover when you need consistency validation.

  1. Open the replication task created in Step 2.

    Open the replication task details

  2. Click the Data Comparison tab. If comparison was not enabled during task creation, click Enable Data Comparison.

    View data comparison results

  3. After additional source changes are synchronized, click Re-compare to validate the latest data.

    Run data comparison again

Step 4: Configure alerts

Migration tasks can run for a long time. Configure alerts so the team is notified when the task fails or replication delay exceeds your threshold.

  1. Open the replication task details page.

    Open the replication task details

  2. Click Configure Alerts.

    Configure task alerts

  3. Enter a Policy Name, review the alert rules, and click Save Configuration.

    Save the alert policy

Result

After full migration completes, incremental synchronization keeps the GCP Cloud SQL for MySQL target updated with new source-side changes. When the replication delay is 0 seconds and validation passes, you can switch application traffic to the target based on your cutover plan.

You can also keep the replication link running after cutover for additional verification, depending on your migration strategy.