Migrating Using a Logical Dump and Replication
Prerequisites
Steps
1
2
Create Users and Grants Separately
mysql -u [username] -p -h [hostname] \
--silent \
--skip-column-names \
-e "SELECT CONCAT('CREATE USER \'', user, '\'@\'', host, '\'
IDENTIFIED BY PASSWORD \'', authentication_string, '\';') \
FROM mysql.user;" > users.sql
mysql -h [hostname] -u [username] -p \
--silent \
--skip-column-names \
-e "SELECT CONCAT('GRANT ', privilege_type, ' ON ', table_schema, '.* \
TO \'', grantee, '\';') \
FROM information_schema.schema_privileges;" > grants.sql
mysql -h [hostname] -u [username] -p \
--silent \
--skip-column-names -e "SELECT CONCAT('GRANT ', privilege_type, ' ON ', table_schema, '.', table_name, ' \
TO \'', grantee, '\';') \
FROM information_schema.table_privileges;" >> grants.sql3
Import Dumps into MariaDB Cloud
mariadb -u [MariaDB Cloud username] -p -h [MariaDB Cloud hostname] --port 3306 --ssl-verify-server-cert < dump.sql
mariadb -u [MariaDB Cloud username] -p -h [MariaDB Cloud hostname] --port 3306 --ssl-verify-server-cert < users.sql
mariadb -u [MariaDB Cloud username] -p -h [MariaDB Cloud hostname] --port 3306 --ssl-verify-server-cert < grants.sqlHints
Performance Optimization During Migration
Data Integrity and Validation
Advanced Migration Techniques
Monitoring and Logging
See Also
Last updated
Was this helpful?

