MariaDB/MySQL
MariaDB/MySQL
Overview
This document guides you through the process of migrating MariaDB and MySQL from SCP-V1 to SCP-V2.
Migration involves transferring all data from the Source DB to the Target DB once and then replicating changes from the Source DB to the Target DB using the Replication method.
Since the Source DB replicates data online using the Replication method, the downtime of the Source DB can be minimized during migration.
Pre-work
This guide only covers DB migration using the SCPSamsung Cloud Platform Console, and the network must be connected between the Source and Target clusters in advance.
Migration Procedure
1. Create Target Cluster
Create a Target DB through the Samsung Cloud Platform Console.
1.1 MariaDB
Database > MariaDB(DBaaS) > Create MariaDB1.2 MySQL
Database > MySQL(DBaaS) > Create MySQLEnter the version and service information of the Target DB. When entering service information, check the following constraints.
Constraints (MariaDB and MySQL)
- The disk allocated to the Target cluster must be at least twice the size of the data used by the Source cluster.
- The actual usage should be twice the allocated disk size, not the disk size itself.
- The following information of the Target cluster must be the same as the Source cluster.
- Database version (Major and Minor versions)
- Database name
- DB character set (Collation)
- Time zone (server timezone)
- The Target cluster must meet the following conditions.
- No backup settings
- No Audit Log settings
The DB character set and Collation refer to the values of the character_set_server and collation_server parameters.
After creating the DB, you need to change these values to match the Source DB in the Parameter Management page.
Backup and Audit Log settings can be changed after creating the DB, so if they are set, you need to change them to unset before configuring migration.
Constraints (MySQL only)
- The following information of the Target cluster must be the same as the Source cluster.
- Table case sensitivity
Check Source Cluster Permissions
To migrate data from the Source DB and perform replication, the following permissions are required.
MariaDB/MySQL Common
- Check migration account permissions
The query execution result must have all the following permissions 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 account' and host='%'show grants for 'Migration account'@'%';
Constraints
The migration account permissions are checked with the host=’%’ condition, so when creating a migration account, the host information must be set to ‘%’.
Add migration account permissions If any of the permissions checked in step 1 are not ‘Y’, you need to add the corresponding permissions to the account.
grant select, lock tables, show view, trigger, event, reload, process, show databases, replication client, replication slave on *.* to 'Migration account'@'%';
Configure Migration
After creating the Target DB, you can configure migration after checking the network connection.
Constraints
- The following Target clusters cannot configure migration.
- Instances of type Replica
- Master clusters with replicas
- Clusters that are not in the Running state
- Clusters that have not completed migration configuration (clusters of type Migration)
- Clusters with Audit Log or backup settings
You can start configuring migration by clicking the ‘Configure Migration’ menu in the upper right corner of the Target DB detail page.
After clicking the ‘Configure Migration’ menu, the migration configuration page will be displayed, where you need to enter the Source DB information according to each item.
- Source DB Database name: Required value. Enter a value starting with a letter, 1-63 characters long.
- Source DB IP: Required value. Enter an IP address in the format (ex. 192.168.10.1).
- Source DB Port: Required value. Enter a port number between 1024 and 65535.
- Source DB username: Required value. Enter a value starting with a letter, 1-80 characters long.
- Source DB password: Required value. Enter a value containing letters, numbers, and special characters (excluding " ‘"), 8-30 characters long.
Cancel
If you click the ‘Cancel’ button, the migration configuration will be canceled, and you will return to the previous page.
Check Connection
After entering the Source DB information, click the ‘Check Connection’ button to check the network, account permissions, database information, and other constraints specified in this guide. If any of the constraints are not met, the connection check will fail, and you will need to check the error message and take action. After a successful connection check, if you modify the Source DB information, the ‘Complete’ button will be deactivated again, and the ‘Check Connection’ button will be activated.
Complete Migration Configuration
If the connection check is successful, the ‘Complete’ button will be activated. Clicking the ‘Complete’ button will start the data migration from the Source DB, and the migration configuration will be completed after the replication connection is successful. This step may take several hours depending on the data size. During migration, the cluster status will be displayed as Migrating, and you will not be able to modify the Target cluster. Clicking the ‘Complete’ button will delete all existing data in the Target DB.
If the Source DB status changes during migration (e.g., stopped, restarted, or switched over), the migration will fail.
You must stop any operations on the Source DB during migration.
| Migration Configuration Result | Menu Activation |
|---|---|
| Successful migration configuration | Master promotion activation, unable to change settings on the detail page |
| Failed migration configuration | Migration configuration activation |
Service Status Synchronization
When the Target cluster status changes to Running and the Master promotion button is activated, the migration is considered successful.
To check the current replication status, click the ‘Service Status Synchronization’ button in the upper right corner of the Target DB detail page and check the replication status.
The replication status can be checked in MariaDB(DBaaS) > MariaDB(DBaaS) list > MariaDB(DBaaS) detail > Work history > Work details by checking the metadata.
Master Promotion
After checking the replication status, click the ‘Master Promotion’ button to complete the migration.
In the Target DB detail page, click the ‘Master Promotion’ button in the upper right corner.
After master promotion, you can change settings on the MariaDB(DBaaS) detail page like a normal cluster.
Parameters set in the Source DB are not migrated. After master promotion, modify the settings to match the Source DB in the **MariaDB(DBaaS) > MariaDB(DBaaS) list > MariaDB(DBaaS) detail > Parameter management** page.

