Skip to content

Commit

Permalink
Update concepts-migrate-dump-restore.md (Typo "flexible server"→"Flex…
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoshioka0128 authored Oct 31, 2024
1 parent ca86520 commit 5e4e533
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions articles/mysql/flexible-server/concepts-migrate-dump-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ ms.topic: conceptual

[!INCLUDE[azure-database-for-mysql-single-server-deprecation](~/reusable-content/ce-skilling/azure/includes/mysql/includes/azure-database-for-mysql-single-server-deprecation.md)]

This article explains two common ways to back up and restore databases in Azure Database for MySQL flexible server.
This article explains two common ways to back up and restore databases in Azure Database for MySQL Flexible Server.

- Dump and restore from the command-line (using mysqldump).
- Dump and restore using PHPMyAdmin.

You can also refer to [Database Migration Guide](https://github.com/Azure/azure-mysql/tree/master/MigrationGuide) for detailed information and use cases about migrating databases to Azure Database for MySQL flexible server. This guide provides guidance that leads the successful planning and execution of a MySQL migration to Azure.
You can also refer to [Database Migration Guide](https://github.com/Azure/azure-mysql/tree/master/MigrationGuide) for detailed information and use cases about migrating databases to Azure Database for MySQL Flexible Server. This guide provides guidance that leads the successful planning and execution of a MySQL migration to Azure.

## Before you begin

To step through this how-to guide, you need to have:

- [An Azure Database for MySQL flexible server instance - Azure portal](../single-server/quickstart-create-mysql-server-database-using-azure-portal.md)
- [An Azure Database for MySQL Flexible Server instance - Azure portal](../single-server/quickstart-create-mysql-server-database-using-azure-portal.md)
- [mysqldump](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html) command-line utility installed on a machine.
- [MySQL Workbench](https://dev.mysql.com/downloads/workbench/) or another third-party MySQL tool to do dump and restore commands.

Expand All @@ -39,19 +39,19 @@ To step through this how-to guide, you need to have:
Most common use-cases are:

- **Moving from other managed service provider** - Most managed service provider may not provide access to the physical storage file for security reasons so logical backup and restore is the only option to migrate.
- **Migrating from on-premises environment or Virtual machine** - Azure Database for MySQL flexible server doesn't support restore of physical backups, which makes logical backup and restore as the ONLY approach.
- **Moving your backup storage from locally redundant to geo-redundant storage** - Azure Database for MySQL flexible server allows configuring locally redundant or geo-redundant storage for backup is only allowed during server create. Once the server is provisioned, you can't change the backup storage redundancy option. In order to move your backup storage from locally redundant storage to geo-redundant storage, dump and restore is the ONLY option.
- **Migrating from alternative storage engines to InnoDB** - Azure Database for MySQL flexible server supports only InnoDB Storage engine, and therefore doesn't support alternative storage engines. If your tables are configured with other storage engines, convert them into the InnoDB engine format before migration to Azure Database for MySQL flexible server.
- **Migrating from on-premises environment or Virtual machine** - Azure Database for MySQL Flexible Server doesn't support restore of physical backups, which makes logical backup and restore as the ONLY approach.
- **Moving your backup storage from locally redundant to geo-redundant storage** - Azure Database for MySQL Flexible Server allows configuring locally redundant or geo-redundant storage for backup is only allowed during server create. Once the server is provisioned, you can't change the backup storage redundancy option. In order to move your backup storage from locally redundant storage to geo-redundant storage, dump and restore is the ONLY option.
- **Migrating from alternative storage engines to InnoDB** - Azure Database for MySQL Flexible Server supports only InnoDB Storage engine, and therefore doesn't support alternative storage engines. If your tables are configured with other storage engines, convert them into the InnoDB engine format before migration to Azure Database for MySQL Flexible Server.

For example, if you have a WordPress or WebApp using the MyISAM tables, first convert those tables by migrating into InnoDB format before restoring to Azure Database for MySQL flexible server. Use the clause `ENGINE=InnoDB` to set the engine used when creating a new table, then transfer the data into the compatible table before the restore.
For example, if you have a WordPress or WebApp using the MyISAM tables, first convert those tables by migrating into InnoDB format before restoring to Azure Database for MySQL Flexible Server. Use the clause `ENGINE=InnoDB` to set the engine used when creating a new table, then transfer the data into the compatible table before the restore.

```sql
INSERT INTO innodb_table SELECT * FROM myisam_table ORDER BY primary_key_columns
```

> [!Important]
> - To avoid any compatibility issues, ensure the same version of MySQL is used on the source and destination systems when dumping databases. For example, if your existing MySQL server is version 5.7, then you should migrate to an Azure Database for MySQL flexible server instance configured to run version 5.7. The `mysql_upgrade` command does not function in an Azure Database for MySQL flexible server instance, and is not supported.
> - If you need to upgrade across MySQL versions, first dump or export your lower version database into a higher version of MySQL in your own environment. Then run `mysql_upgrade` before attempting migration into an Azure Database for MySQL flexible server instance.
> - To avoid any compatibility issues, ensure the same version of MySQL is used on the source and destination systems when dumping databases. For example, if your existing MySQL server is version 5.7, then you should migrate to an Azure Database for MySQL Flexible Server instance configured to run version 5.7. The `mysql_upgrade` command does not function in an Azure Database for MySQL Flexible Server instance, and is not supported.
> - If you need to upgrade across MySQL versions, first dump or export your lower version database into a higher version of MySQL in your own environment. Then run `mysql_upgrade` before attempting migration into an Azure Database for MySQL Flexible Server instance.
## Performance considerations

Expand All @@ -67,29 +67,29 @@ To optimize performance, take notice of these considerations when dumping large
- Use the `defer-table-indexes` option in mysqldump when dumping databases, so that index creation happens after tables data is loaded.
- Copy the backup files to an Azure blob/store and perform the restore from there, which should be a lot faster than performing the restore across the Internet.

## Create a database on the target Azure Database for MySQL flexible server instance
## Create a database on the target Azure Database for MySQL Flexible Server instance

Create an empty database on the target Azure Database for MySQL flexible server instance where you want to migrate the data. Use a tool such as MySQL Workbench or mysql.exe to create the database. The database can have the same name as the database that is contained the dumped data or you can create a database with a different name.
Create an empty database on the target Azure Database for MySQL Flexible Server instance where you want to migrate the data. Use a tool such as MySQL Workbench or mysql.exe to create the database. The database can have the same name as the database that is contained the dumped data or you can create a database with a different name.

To get connected, locate the connection information in the **Overview** of your Azure Database for MySQL flexible server instance.
To get connected, locate the connection information in the **Overview** of your Azure Database for MySQL Flexible Server instance.

:::image type="content" source="./media/concepts-migrate-dump-restore/1-server-overview-name-login.png" alt-text="Find the connection information in the Azure portal":::

Add the connection information into your MySQL Workbench.

:::image type="content" source="./media/concepts-migrate-dump-restore/2-setup-new-connection.png" alt-text="MySQL Workbench Connection String":::

## Preparing the target Azure Database for MySQL flexible server instance for fast data loads
## Preparing the target Azure Database for MySQL Flexible Server instance for fast data loads

To prepare the target Azure Database for MySQL flexible server instance for faster data loads, the following server parameters and configuration needs to be changed.
To prepare the target Azure Database for MySQL Flexible Server instance for faster data loads, the following server parameters and configuration needs to be changed.

- max_allowed_packet – set to 1073741824 (that is, 1 GB) to prevent any overflow issue due to long rows.
- slow_query_log – set to OFF to turn off the slow query log. This eliminates the overhead caused by slow query logging during data loads.
- query_store_capture_mode – set to NONE to turn off the Query Store. This eliminates the overhead caused by sampling activities by Query Store.
- innodb_buffer_pool_size – Scale up the server to 32 vCore Memory Optimized SKU from the Pricing tier of the portal during migration to increase the innodb_buffer_pool_size. Innodb_buffer_pool_size can only be increased by scaling up compute for the Azure Database for MySQL flexible server instance.
- innodb_buffer_pool_size – Scale up the server to 32 vCore Memory Optimized SKU from the Pricing tier of the portal during migration to increase the innodb_buffer_pool_size. Innodb_buffer_pool_size can only be increased by scaling up compute for the Azure Database for MySQL Flexible Server instance.
- innodb_io_capacity & innodb_io_capacity_max - Change to 9000 from the Server parameters in Azure portal to improve the IO utilization to optimize for migration speed.
- innodb_write_io_threads & innodb_write_io_threads - Change to 4 from the Server parameters in Azure portal to improve the speed of migration.
- Scale up Storage tier – The IOPs for Azure Database for MySQL flexible server increases progressively with the increase in storage tier. For faster loads, you may want to increase the storage tier to increase the IOPs provisioned. Do remember the storage can only be scaled up, not down.
- Scale up Storage tier – The IOPs for Azure Database for MySQL Flexible Server increases progressively with the increase in storage tier. For faster loads, you may want to increase the storage tier to increase the IOPs provisioned. Do remember the storage can only be scaled up, not down.

Once the migration is completed, you can revert back the server parameters and compute tier configuration to its previous values.

Expand Down Expand Up @@ -143,7 +143,7 @@ Once you've created the target database, you can use the mysql command to resto
mysql -h [hostname] -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]
```

In this example, restore the data into the newly created database on the target Azure Database for MySQL flexible server instance.
In this example, restore the data into the newly created database on the target Azure Database for MySQL Flexible Server instance.

Here's an example for how to use this **mysql** for **Single Server** :

Expand Down Expand Up @@ -185,7 +185,7 @@ To export, you can use the common tool phpMyAdmin, which you may already have in
Importing your database is similar to exporting. Do the following actions:

1. Open phpMyAdmin.
2. In the phpMyAdmin setup page, select **Add** to add your Azure Database for MySQL flexible server instance. Provide the connection details and log in information.
2. In the phpMyAdmin setup page, select **Add** to add your Azure Database for MySQL Flexible Server instance. Provide the connection details and log in information.
3. Create an appropriately named database and select it on the left of the screen. To rewrite the existing database, select the database name, select all the check boxes beside the table names, and select **Drop** to delete the existing tables.
4. Select the **SQL** link to show the page where you can type in SQL commands, or upload your SQL file.
5. Use the **browse** button to find the database file.
Expand All @@ -197,6 +197,6 @@ For known issues, tips and tricks, we recommend you to look at our [techcommunit

## Next steps

- [Connect applications to Azure Database for MySQL flexible server](../single-server/how-to-connection-string.md).
- For more information about migrating databases to Azure Database for MySQL flexible server, see the [Database Migration Guide](https://github.com/Azure/azure-mysql/tree/master/MigrationGuide).
- [Connect applications to Azure Database for MySQL Flexible Server](../single-server/how-to-connection-string.md).
- For more information about migrating databases to Azure Database for MySQL Flexible Server, see the [Database Migration Guide](https://github.com/Azure/azure-mysql/tree/master/MigrationGuide).
- If you're looking to migrate large databases with database sizes more than 1 TB, you may want to consider using community tools like **mydumper/myloader** which supports parallel export and import. Learn [how to migrate large MySQL databases](https://techcommunity.microsoft.com/t5/azure-database-for-mysql/best-practices-for-migrating-large-databases-to-azure-database/ba-p/1362699).

0 comments on commit 5e4e533

Please sign in to comment.