Skip to content

Commit b3f55dd

Browse files
committed
Merge branch 'dmsconcepts' of https://github.com/aditivgupta/azure-docs-pr
2 parents 7577584 + d2db2f2 commit b3f55dd

5 files changed

+163
-2
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: MySQL to Azure Database for MySQL Data Migration - MySQL Login Migration
3+
description: Learn how to use the Azure Database for MySQL Data Migration - MySQL Login Migration
4+
author: adig
5+
ms.author: adig
6+
ms.date: 07/24/2023
7+
ms.service: dms
8+
ms.topic: conceptual
9+
ms.custom: references_regions
10+
---
11+
12+
# MySQL to Azure Database for MySQL Data Migration - MySQL Login Migration
13+
14+
MySQL Login Migration is a new feature that allows users to migrate user account and privileges, including users with no passwords. With this feature, businesses will now be able to migrate a subset of the data in the ‘mysql’ system database from the source to the target for both offline and online migration scenarios. This login migration experience automates manual tasks such as the synchronization of logins with their corresponding user mappings and replicating server permissions and server roles.
15+
16+
## Current implementation
17+
18+
In the current implementation, users can select the **Migrate user account and privileges** checkbox in the **Select databases** tab under **Select Server Objects** section when configuring the DMS migration project.
19+
:::image type="content" source="media/tutorial-mysql-to-azure-mysql-online/16-select-db.png" alt-text="Screenshot of a Select database.":::
20+
21+
Additionally, any corresponding databases that have related grants must also be selected for migration in the **Select Databases** section.
22+
23+
The progress and overall migration summary can be viewed in the **Initial Load** tab. On the **migration summary** blade, users can click into the **‘mysql’** system database to review the results of migrating server level objects, like users and grants.
24+
25+
### How Login Migration works
26+
27+
As part of Login migration, we will migrate a subset of the tables in the ‘mysql’ system database depending on the version of your source. The tables we migrate for all versions are: user, db, tables_priv, columns_priv, and procs_priv. For 8.0 sources we also migrate the following tables: role_edges, default_roles, and global_grants.
28+
29+
## Limitations
30+
31+
* Only server dynamic grants are migrated.
32+
* Only users configured with the mysql_native_password authentication plug-in will be migrated to the target server. Users relying on other plug-ins are not supported.
33+
* The account_locked field from the user table is not migrated. If the account is locked on the source server, it isn't locked on the target server after migration.
34+
* The proxies_priv grant table and password_history grant table are not migrated.
35+
* The password_expired field from user table is not migrated.
36+
* Migration of global_grants table only migrates the following grants: xa_recover_admin, role_admin.
37+
38+
## Next steps
39+
40+
* [Tutorial: Migrate MySQL to Azure Database for MySQL offline using DMS](tutorial-mysql-azure-mysql-offline-portal.md)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: MySQL to Azure Database for MySQL Data Migration - MySQL Replicate Changes
3+
description: Learn how to use the Azure Database for MySQL Data Migration - MySQL Replicate Changes
4+
author: adig
5+
ms.author: adig
6+
ms.date: 07/23/2023
7+
ms.service: dms
8+
ms.topic: conceptual
9+
ms.custom: references_regions
10+
---
11+
12+
# MySQL to Azure Database for MySQL Data Migration - MySQL Replicate Changes
13+
14+
Running a Replicate changes Migration, with our offline scenario with “Enable Transactional Consistency", enables businesses to migrate their databases to Azure while the databases continue to be operational. In other words, migrations can be completed with minimum downtime for critical applications, limiting the impact to service level availability and inconvenience to their end customers.
15+
16+
## Current implementation
17+
18+
You must run an offline migration scenario with “Enable Transactional Consistency" to get the bin log file and position to start replicating the incoming changes. The DMS portal UI shows the binary log filename and position aligned to the time the locks were obtained on the source for the consistent snapshot. You can this value in our replicate changes migration to begin streaming the incoming changes.
19+
20+
:::image type="content" source="media/tutorial-azure-mysql-single-to-flex-offline/offline-migration-wizard-updated.png" alt-text="Screenshot of an Add source details screen.":::
21+
22+
While running the replicate changes migration, when your target is almost caught up with the source server, stop all incoming transactions to the source database, and then wait until all pending transactions have been applied to the target database. To confirm that the target database is up-to-date, on the source server, run the query 'SHOW MASTER STATUS;', and then compare that position to the position of the last committed binlog event (displayed under Migration Progress). When the two positions are the same, the target has caught up with all changes, and you can start cutover.
23+
24+
### How Replicate Changes works
25+
26+
The current implementation is based on streaming binlog changes from the source server and applying them to the target server. Similar to Data-in replication, this is easier to set up and doesn't require a physical connection between the source and the target servers.
27+
28+
Binlog can be sent by the server as a stream that contains binary data as documented [here] (<https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_replication.html>). The client can specify the initial log position to start the stream with. The log position is described by the log file name, the position within that file, and optionally GTID (Global Transaction ID) if gtid mode is enabled at the source.
29+
30+
The data changes are sent as "row" events, which contain data for individual rows (prior and/or after the change depending on the operation type, which is insert, delete, update). The row events are then applied in their raw format using a BINLOG statement: [MySQL 8.0 Reference Manual :: 13.7.8.1 BINLOG Statement](<https://dev.mysql.com/doc/refman/8.0/en/binlog.html>).
31+
32+
## Prerequisites
33+
34+
To complete the replicate changes migration successfully, ensure that the following prerequisites are in place:
35+
36+
* Use the MySQL command line tool of your choice to determine whether **log_bin** is enabled on the source server. The Binlog isn't always turned on by default, so verify that it's enabled before starting the migration. To determine whether log_bin is enabled on the source server, run the command: **SHOW VARIABLES LIKE 'log_bin’**
37+
* Ensure that the user has **“REPLICATION_APPLIER”** or **“BINLOG_ADMIN”** permission on target server for applying the bin log.
38+
* Ensure that the user has **“REPLICATION SLAVE”** permission on target server.
39+
* Ensure that the user has **“REPLICATION CLIENT”** and **“REPLICATION SLAVE”** permission on source server for reading and applying the bin log.
40+
* Run an offline migration scenario with “**Enable Transactional Consistency"** to get the bin log file and position.
41+
* If you're targeting a replicate changes migration, configure the **binlog_expire_logs_seconds** parameter on the source server to ensure that binlog files aren't purged before the replica commits the changes. We recommend at least two days to begin with. After a successful cutover, the value can be reset.
42+
43+
## Limitations
44+
45+
* When performing a replicate changes migration, the name of the database on the target server must be same as the name on source server.
46+
* Support is limited to the ROW binlog format.
47+
48+
## Next steps
49+
50+
- [Tutorial: Migrate MySQL to Azure Database for MySQL offline using DMS](tutorial-mysql-azure-mysql-offline-portal.md)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: MySQL to Azure Database for MySQL Data Migration - MySQL Schema Migration
3+
description: Learn how to use the Azure Database for MySQL Data Migration - MySQL Schema Migration
4+
author: adig
5+
ms.author: adig
6+
ms.date: 07/23/2023
7+
ms.service: dms
8+
ms.topic: conceptual
9+
ms.custom: references_regions
10+
---
11+
12+
# MySQL to Azure Database for MySQL Data Migration - MySQL Schema Migration
13+
14+
MySQL Schema Migration is a new feature that allows users to migrate the schema for objects such as tables, views, triggers, events, stored procedures, and functions. This feature is useful for automating some of work required to prepare the target database prior to starting a migration.
15+
16+
## Current implementation
17+
18+
In the current implementation, users can select the **server objects (views, triggers, events, routines)** that they want to migrate in **Select databases** tab under **Select Server Objects** section when configuring the DMS migration project. Additionally, they can select the databases under **Select databases** section whose schema is to be migrated.
19+
:::image type="content" source="media/tutorial-mysql-to-azure-mysql-online/16-select-db.png" alt-text="Screenshot of a Select database.":::
20+
21+
To migrate the schema for table objects, navigate to the **Select tables** tab. Before the tab populates, DMS fetches the tables from the selected database(s) on the source and target, and then determines whether the table exists and contains data. If you select a table in the source database that doesn't exist on the target database, the box under **Migrate schema** is selected by default. For tables that do exist in the target database, a note indicates that the selected table already contains and will be truncated. In addition, if the schema of a table on the target server doesn't match the schema on the source, the table will be dropped before the migration continues.
22+
23+
:::image type="content" source="media/tutorial-mysql-to-azure-mysql-online/17-select-tables.png" alt-text="Screenshot of a Select Tables.":::
24+
25+
When you continue to the next tab, DMS validates your inputs and confirms that the tables selected match if they were selected without the schema migration input. Once the validation passes, you can begin the migration scenario.
26+
27+
After you begin the migration and as the migration progresses, each table is created prior to migrating its data from the source to the target. Except for triggers and views, which are migrated after data migration is complete, other objects are created for tables prior to the data migration.
28+
29+
### How Schema Migration works
30+
31+
Schema migration is supported by MySQL’s **“SHOW CREATE”** syntax to gather schema information for objects from the source. When migrating the schema for the objects from the source to the target, DMS processes the input and individually migrates the objects. DMS also wraps the collation, character set, and other relevant information that is provided by the “SHOW CREATE” query to the create query that is then processed on to the target.
32+
33+
**Routines** and **Events** are migrated before any data is migrated. The schema for each individual **table** is migrated immediately prior to data movement starting for the table. **Triggers** are migrated after the data migration portion. For **views**, since MySQL validates the contents of views and they can depend on other tables, DMS first creates tables for views before the start of database data movement and then drops the temporary table and creates the view.
34+
35+
When querying the source and target, if a transient error occurs, DMS **retries** the queries. However, if an error occurs that DMS can't recover from – as an example, an invalid syntax when performing a version upgrade migration – DMS fails and report that error message on completion. If the failure occurs when creating a table, the data for that table isn't migrated, but the data and schema migration for the other selected tables is attempted. If an unrecoverable error occurs for events, routines, or when creating the temporary table for views, the migration fails prior to running the migration for the selected tables and the objects that are migrated following the data migration portion.
36+
37+
Since a temporary table is created for views, if there's a failure migrating a view, the temporary table is left on the target. After the underlying issue is fixed and the migration is retried, DMS deletes that table prior to creating the view. Alternatively, if electing not to use schema migration for views in a future migration, the temporary table needs to be manually deleted prior to manually migrating the view.
38+
39+
## Prerequisites
40+
41+
To complete a schema migration successfully, ensure that the following prerequisites are in place.
42+
43+
* “READ” privilege on the source database.
44+
* “SELECT” privilege for the ability to select objects from the database
45+
* If migrating views, the user must have the “SHOW VIEW” privilege.
46+
* If migrating triggers, the user must have the “TRIGGER” privilege.
47+
* If migrating routines (procedures and/or functions), the user must be named in the definer clause of the routine. Alternatively, based on version, the user must have the following privilege:
48+
* For 5.7, have “SELECT” access to the “mysql.proc” table.
49+
* For 8.0, have “SHOW_ROUTINE” privilege or have the “CREATE ROUTINE,” “ALTER ROUTINE,” or “EXECUTE” privilege granted at a scope that includes the routine.
50+
* If migrating events, the user must have the “EVENT” privilege for the database from which the events are to be shown.
51+
52+
## Limitations
53+
54+
* When migrating non table objects, DMS doesn't support renaming databases.
55+
* When migrating to a target server that has bin_log enabled, log_bin_trust_function_creators should be enabled to allow for creation of routines and triggers.
56+
* When migrating please ensure that the database exists on the target server. Schema migration only supports migrating objects and doesn't support creating the database on the target server.
57+
* Currently there's no support for migrating the DEFINER clause for objects. All object types with definers on source get dropped and after the migration the default definer for tables are set to the login used to run the migration.
58+
* We haven't tested version upgrade scenarios and results aren't guaranteed. Some version upgrades aren't supported if there are breaking changes in version compatibility. Refer to the MySQL docs for more information on version upgrades.
59+
* Currently we can only migrate schema as part of data movement. If nothing is selected for data movement, no schema migration happens. If a table is selected for schema migration, it is selected for data movement.
60+
61+
## Next steps
62+
63+
- Learn more about [Data-in Replication](../mysql/concepts-data-in-replication.md)
64+
65+
- [Tutorial: Migrate MySQL to Azure Database for MySQL offline using DMS](tutorial-mysql-azure-mysql-offline-portal.md)

articles/dms/migrate-azure-mysql-consistent-backup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: MySQL to Azure Database for MySQL Data Migration - MySQL Consistent Backup (Preview)
2+
title: MySQL to Azure Database for MySQL Data Migration - MySQL Consistent Backup
33
description: Learn how to use the Azure Database for MySQL Data Migration - MySQL Consistent Backup for transaction consistency even without making the Source server read-only
44
author: karlaescobar
55
ms.author: karlaescobar
@@ -9,7 +9,7 @@ ms.topic: conceptual
99
ms.custom: references_regions
1010
---
1111

12-
# MySQL to Azure Database for MySQL Data Migration - MySQL Consistent Backup (Preview)
12+
# MySQL to Azure Database for MySQL Data Migration - MySQL Consistent Backup
1313

1414
MySQL Consistent Backup is a new feature that allows users to take a Consistent Backup of a MySQL server without losing data integrity at source because of ongoing CRUD (Create, Read, Update, and Delete) operations. Transactional consistency is achieved without the need to set the source server to read-only mode through this feature.
1515

articles/dms/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
items:
5151
- name: MySQL to Azure Database for MySQL Data Migration - MySQL Consistent Backup
5252
href: migrate-azure-mysql-consistent-backup.md
53+
- name: MySQL to Azure Database for MySQL Data Migration - MySQL Schema Migration
54+
href: concepts-migrate-azure-mysql-schema migration.md
55+
- name: MySQL to Azure Database for MySQL Data Migration - MySQL Login Migration
56+
href: concepts-migrate-azure-mysql-login-migration.md
57+
- name: MySQL to Azure Database for MySQL Data Migration - MySQL Replicate Changes
58+
href: concepts-migrate-azure-mysql-replicate-changes.md
5359
- name: Security
5460
items:
5561
- name: Security baseline

0 commit comments

Comments
 (0)