The page has been translated by Gen AI.

MariaDB/MySQL

MariaDB/MySQL

Overview

This document guides how to migrate MariaDB and MySQL used in SCP V to SCP V2. Migration proceeds by first transferring all data from the Source DB to the Target DB, and then replicating changes from the Source DB to the Target DB using a replication method.
Since the Source DB replicates data via replication while in an online state, the downtime of the Source DB can be minimized during migration.

Preliminary work

Info
  • Provides guidance only on DB migration using SCP (Samsung Cloud Platform), and the network between the Source and Target clusters must be connected in advance.
  • The DB port used between the Source and Target clusters must be the same, and the Target DB must be able to access the Source DB’s DB port.

Migration Procedure

1. ## Create target cluster

Create the Target DB according to the following procedure.

  1. All Services > Database > MariaDB (DBaaS) > Create MariaDB / Create MySQL Click the menu. 1. Go to the Service Home page of MariaDB (DBaaS) / MySQL (DBaaS).
  2. On the Service Home page, click the Create MariaDB(DBaaS)/MySQL(DBaaS) button. 2. Navigate to the MariaDB(DBaaS)/MySQL(DBaaS) Create page.
  3. On the Create MariaDB(DBaaS)/MySQL(DBaaS) page, enter the information required to create the service and select detailed options.
  4. Enter the version and service information of the target DB. 4. When entering service information, the following constraints are confirmed.

Constraints (MariaDB, MySQL common)

  • You must allocate disk space that is at least about twice the size of the data used by the source cluster.
    • We need twice the actual usage, not based on the allocated disk.
  • The information below for the Target cluster must be the same as the Source cluster.
    • Database version (Major, Minor version)
    • Port
    • Database name
    • DB character set (Collation)
    • Time zone (server Timzone)
  • The target cluster must meet the following conditions.
    • Backup not configured
    • Audit Log not set

Constraints (MySQL Only)

  • The information below for the Target cluster must be identical to that of the Source cluster.
    • Table case sensitivity
안내

* The DB character set and collation correspond to the values of the character_set_server and collation_server parameters.
* After creating the DB, you need to modify it on the Parameter management page to match the Source DB.
* Since backup and Audit Log settings can be changed after the database is created, if they are set, you must change them to unset on the detail page before configuring the migration.

2. ## Check source cluster permissions

To migrate data from the source DB and perform replication, the following permissions are required.

MariaDB/MySQL common

  1. Check migration account permissions The query execution result must have all the permissions below set to ‘Y’.

    select select_priv
         , lock_tables_priv
         , show_view_priv
         , trigger_priv
         , event_priv
         , reload_priv
         , process_priv
         , show_db_priv
         , repl_client_priv
         , repl_slave_priv
      from mysql.user where user='Migration용 계정' and host='%'
    

    Alternatively, you can check the permissions granted to the current account using the command below.

    show grants for 'Migration용 계정'@'%';
    

Constraints Since the migration account’s privileges are verified with the condition host=’%’, the Host information must be set to ‘%’ when creating the migration account.

  1. Add account permissions for migration If there is a value other than Y among the account permissions performed in step 1, you must add the permission to that account.

    grant select, lock tables, show view, trigger, event, reload, process, show databases, replication client, replication slave on *.* to 'Migration용 계정'@'%';
    

3. ## Migration configuration

After the Target DB is created, you can verify the network connection and then perform the migration configuration.

Info
Since the target DB performs migration via the source DB’s DB port, communication through that port must be possible.

Constraints

  • The target cluster listed below cannot be used for migration configuration.
    • When the instance type is Replica.
    • When the Master cluster has a replica
    • When not in Running state
    • When the Migration configuration has been performed but the Master has not yet been promoted (i.e., the cluster type is Migration)
    • Audit Log, when backup is configured

On the detail page of the Target DB, you can start the setup by clicking the Migration configuration menu in the upper right corner.

  1. Click the All Services > Database > MariaDB(DBaaS) > MariaDB(DBaaS) Details menu. 1. Navigate to the MariaDB(DBaaS)/MySQL(DBaaS) Details page.
  2. MariaDB(DBaaS)/MySQL(DBaaS) Details Click the More button at the top right of the page. 2. More menus are displayed.
  3. Click the Migration configuration menu. 3. After checking the message in the notification popup, click the Confirm button.
  4. Enter the version and service information of the target DB. 4. When entering service information, the following constraints are confirmed.
  • Source DB Database name : required value. * Begin with an English character and enter between 1 and 63 characters.
  • Source DB IP : required value. * IP format (e.g. * Enter as 192.168.10.1).
  • Source DB Port : Required value. * The allowable range for port input is 1024 to 65535.
  • Source DB username : required value. * Start with English and enter between 1 and 80 characters.
  • Source DB password: required value. * Enter 8 to 30 characters, including English letters, numbers, and special characters (excluding " and ‘).

Cancel

Cancel button, when selected, cancels the Migration configuration and returns to the previous page.

Connection check

After entering the Source DB information, click the Check Connection button to verify constraints specified in this guide, such as network, account permissions, and database information. If any constraint is not met, the connection check fails, and you must review the error message and take corrective action. After successfully verifying the connection, if you modify the information for the Source DB, Complete button becomes disabled again and the ‘Verify Connection’ button becomes enabled.

Migration configuration completed

If the connection check succeeds, the Complete button will be enabled. When you click the Complete button, the data transfer from the Source DB begins, and after transferring all data once and successfully establishing the Replication connection, the migration configuration is completed.
This step may take several hours or more depending on the size of the data. During migration, the cluster status is shown as Migrating, and while Migrating you cannot perform modifications on the Target cluster. Clicking the Migration configuration complete button will delete all data in the current Target DB.

information
  • If the source DB’s state changes (e.g., stop, restart, switch over) while the target DB is in a Migrating state, the migration operation fails. *
  • You must stop operations on the Source DB during migration.
Migration Configuration ResultMenu activation
When migration configuration succeedsEnable Master promotion; settings cannot be changed on the detail page
When migration configuration failsEnable migration configuration
Table. Menu activation based on migration configuration results

Service status synchronization

When the target cluster in Migrating state becomes Running and the Master promotion button is enabled, the migration has been performed successfully.
To check the current replication status, go to the detail page of the Target DB, click the ‘Service Status Sync’ button at the top right, and then you can view the replication status.
Please check the eventdata item in MariaDB(DBaaS) > MariaDB(DBaaS) List > MariaDB(DBaaS) Details > Job History > Click Job Details > Job Details for the replication status.

4. ## Master promotion

After checking the replication status, click the Master promotion button to complete the migration.

  1. All Services > Database > MariaDB (DBaaS) > MariaDB (DBaaS) Details Click the menu. 1. Navigate to the MariaDB(DBaaS)/MySQL(DBaaS) Details page.
  2. MariaDB(DBaaS)/MySQL(DBaaS) Details Click the Master Promotion button at the top right of the page.
  3. It changes to Editing state, and when Master promotion is completed, it changes to Running state.
Information
  • Parameters configured in the source DB are not migrated. * After Master promotion, modify on the MariaDB(DBaaS) > MariaDB(DBaaS) List > MariaDB(DBaaS) Details > Parameter Management page according to the Source DB settings. *
  • User account information is synchronized from Source. * After promoting to Master, use the Source DB’s account information to connect to the DB.