Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Data Transfer
  • Available transfers
  • Getting started
    • All tutorials
      • PostgreSQL cluster
      • Data in MySQL®
      • Third-party MySQL® cluster
      • MongoDB cluster
      • Migrating MongoDB cluster from 4.4 to 6.0
      • ClickHouse® cluster
      • Data resharding in a Managed Service for ClickHouse® cluster
      • Greenplum® cluster
      • Migrating data from AWS RDS for PostgreSQL
      • OpenSearch cluster
  • Troubleshooting
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials

In this article:

  • Required paid resources
  • Getting started
  • Transferring data
  • See also
  1. Tutorials
  2. Migration
  3. Third-party MySQL® cluster

Migrating to a third-party MySQL® cluster

Written by
Yandex Cloud
Improved by
Dmitry A.
Updated at May 5, 2025
  • Required paid resources
  • Getting started
  • Transferring data
  • See also

To migrate a database deployed in a Yandex Managed Service for MySQL® cluster to a third-party MySQL® cluster:

  1. Transfer data.
  2. Disable data writes to the source database.
  3. Transfer the load to a third-party cluster.

Migration across versions is supported. For example, you can move databases from MySQL® 5.7 to 8. The MySQL® major version on a third-party cluster must be the same or higher than the version in the Yandex Managed Service for MySQL® cluster.

Required paid resourcesRequired paid resources

The support cost for this solution includes a transfer fee, which covers the use of computing resources and the number of transferred data rows (see Data Transfer pricing).

Getting startedGetting started

Create a MySQL® cluster with any suitable configuration. In this case, the following applies:

  • The MySQL® version must be the same or higher than the version in the source cluster.

    Transferring data with MySQL® major version upgrade is possible but not guaranteed. For more information, see the relevant MySQL® documentation.

    You cannot perform migration while downgrading MySQL® version.

  • SQL mode must be the same as in the source cluster.

Transferring dataTransferring data

  1. Prepare the source cluster database.

  2. Prepare the target cluster database.

  3. Set up the endpoints and transfer:

    Manually
    Terraform
    1. Create a source endpoint:

      • Database type: MySQL.

      • Connection settings: Managed Service for MySQL cluster.

        Specify the source cluster ID.

    2. Create a target endpoint:

      • Database type: MySQL.

      • Connection settings: Custom installation.

        Specify the target cluster connection settings.

    3. Create a transfer of the Snapshot and increment type that will use the created endpoints.

    4. Activate the transfer.

    1. If you do not have Terraform yet, install it.

    2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

    3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

    4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

    5. Download the transfer and the data-transfer-mmy-mysql.tf endpoint configuration file to the same working directory.

    6. Specify the following in the configuration file:

      • Source endpoint parameters.
      • Target endpoint parameters.
    7. Check that the Terraform configuration files are correct using this command:

      terraform validate
      

      If there are any errors in the configuration files, Terraform will point them out.

    8. Create the required infrastructure:

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

      All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

      Once created, your transfer will be activated automatically.

    Warning

    Avoid any changes to the data schema in the source and target clusters during the transfer operation. For more information, see Working with databases during transfer.

  4. Wait for the transfer status to change to Replicating.

  5. Switch the source cluster to "read-only" mode and transfer the load to the target cluster.

  6. On the transfer monitoring page, wait for the Maximum data transfer delay metric to decrease to zero. This means that all changes that occurred in the source cluster after data was copied are transferred to the target cluster.

  7. Deactivate the transfer and wait for its status to change to Stopped.

    For more information about transfer statuses, see Transfer lifecycle.

  8. Delete the endpoints and the transfer you created:

    Manually
    Terraform

    If you created your endpoints and transfer manually:

    1. Delete the stopped transfer.
    2. Delete endpoints for both the source and target.

    If you used Terraform to create your endpoints and transfer:

    1. In the terminal window, go to the directory containing the infrastructure plan.

      Warning

      Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

    2. Delete resources:

      1. Run this command:

        terraform destroy
        
      2. Confirm deleting the resources and wait for the operation to complete.

      All the resources described in the Terraform manifests will be deleted.

See alsoSee also

For other migration methods, see the Yandex Managed Service for MySQL® documentation.

Was the article helpful?

Previous
Data in MySQL®
Next
MongoDB cluster
© 2025 Direct Cursus Technology L.L.C.