az mysql flexible-server import
Manage import workflows for MySQL Flexible Servers.
Commands
Name | Description | Type | Status |
---|---|---|---|
az mysql flexible-server import create |
Create a new import workflow for flexible server. |
Core | GA |
az mysql flexible-server import stop-replication |
To stop replication between the source single server and target flexible server. |
Core | GA |
az mysql flexible-server import create
Create a new import workflow for flexible server.
This command is used for following two purposes: To Migrate an external MySQL server to Azure MySQL Flexible server whose backup is stored on an Azure Blob Container. To Migrate a Azure MySQL single server to Azure MySQL Flexible server. For more information for network configuration, see
- Migrate Azure Database for MySQL - Single Server to Flexible Server using Azure Database for MySQL Import CLI https://learn.microsoft.com/en-us/azure/mysql/migrate/migrate-single-flexible-mysql-import-cli
- Configure public access https://docs.microsoft.com/en-us/azure/mysql/flexible-server/how-to-manage-firewall-cli
- Configure private access https://docs.microsoft.com/en-us/azure/mysql/flexible-server/how-to-manage-virtual-network-cli.
az mysql flexible-server import create --data-source
--data-source-type {azure_blob, mysql_single}
--name
--resource-group
[--address-prefixes]
[--admin-password]
[--admin-user]
[--auto-scale-iops {Disabled, Enabled}]
[--backup-identity]
[--backup-key]
[--backup-retention]
[--data-source-backup-dir]
[--data-source-sas-token]
[--geo-redundant-backup {Disabled, Enabled}]
[--high-availability {Disabled, SameZone, ZoneRedundant}]
[--identity]
[--iops]
[--key]
[--location]
[--mode {Offline, Online}]
[--private-dns-zone]
[--public-access]
[--sku-name]
[--standby-zone]
[--storage-auto-grow {Disabled, Enabled}]
[--storage-size]
[--subnet]
[--subnet-prefixes]
[--tags]
[--tier]
[--version]
[--vnet]
[--yes]
[--zone]
Examples
Trigger an Import from azure mysql single server.
az mysql flexible-server import create --data-source-type mysql_single \
--data-source test-single-server --resource-group test-rg \
--location northeurope --name testserver \
--sku-name Standard_B1ms --tier Burstable --public-access 0.0.0.0 \
--storage-size 32 --tags "key=value" --version 5.7 --high-availability ZoneRedundant \
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
Trigger an Online Import from azure mysql single server.
az mysql flexible-server import create --data-source-type mysql_single \
--data-source test-single-server --mode "Online" --resource-group test-rg \
--location northeurope --name testserver \
--sku-name Standard_B1ms --tier Burstable --public-access 0.0.0.0 \
--storage-size 32 --tags "key=value" --version 5.7 --high-availability ZoneRedundant \
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
Trigger a Import from source backup stored in azure blob container.
az mysql flexible-server import create --data-source-type "azure_blob" \
--data-source "https://teststorage.blob.windows.net/backupcontainer" \
--resource-group test-rg --name testserver --version 5.7 --location northeurope \
--admin-user "username" --admin-password "password" \
--sku-name Standard_D2ds_v4 --tier GeneralPurpose --public-access 0.0.0.0 \
--storage-size 32 --tags "key=value" --high-availability ZoneRedundant \
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
Trigger import from source backup stored in azure blob container. (Backup files not present in container root. Instead present in backupdata/data/)
az mysql flexible-server import create --data-source-type "azure_blob" \
--data-source "https://teststorage.blob.windows.net/backupcontainer" \
--data-source-backup-dir "backupdata/data/" \
--resource-group test-rg --name testserver --version 5.7 --location northeurope \
--admin-user "username" --admin-password "password" \
--sku-name Standard_D2ds_v4 --tier GeneralPurpose --public-access 0.0.0.0 \
--storage-size 32 --tags "key=value" --high-availability ZoneRedundant \
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
Trigger import from source backup stored in azure blob container. (Backup files present in container root and blob storage accessible through sas token with Read and List permissions. Please pass '--%' in the command with SAS token.)
az mysql flexible-server import create --data-source-type "azure_blob" \
--data-source "https://teststorage.blob.windows.net/backupcontainer" \
--data-source-sas-token "sp=r&st=2023-07-20T10:30:07Z..." \
--resource-group test-rg --name testserver --version 5.7 --location northeurope \
--admin-user "username" --admin-password "password" \
--sku-name Standard_D2ds_v4 --tier GeneralPurpose --public-access 0.0.0.0 \
--storage-size 32 --tags "key=value" --high-availability ZoneRedundant \
--zone 1 --standby-zone 3 --storage-auto-grow Enabled --iops 500
Required Parameters
Data source for importing to Flexible Server. Based on the data source type provide the data source as mentioned below. e.g., mysql_single: The name or resource ID of the Azure MySQL single server. azure_blob: The name or resource ID of the Azure blob container. The storage uri of the azure blob container. Example: https://{blob_name}.blob.core.windows.net/{container_name}. The storage uri should not contain the sas token. If required, sas token can be provided in "data-source-sas-token" parameter.
Data source type. e.g., mysql_single: Azure Database for MySQL Servers. azure_blob: Source backup provided in Azure blob container.
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.
The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.
Administrator username for the server. Once set, it cannot be changed.
Enable or disable the auto scale iops. Default value is Disabled.
The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.
The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.
The number of days a backup is retained. Range of 1 to 35 days. Default is 7 days.
Relative path of the directory in which source backup is stored. By default, the backup files will be read from the root of storage. This parameter is valid for storage based data source. Example: azure_blob.
Sas token for accessing the data source. This parameter is valid for storage based data source. Example: azure_blob.
Whether or not geo redundant backup is enabled.
Enable (ZoneRedundant or SameZone) or disable high availability feature.
The name or resource ID of the user assigned identity for data encryption.
Number of IOPS to be allocated for this server. You will get certain amount of free IOPS based on compute and storage provisioned. The default value for IOPS is free IOPS. To learn more about IOPS based on compute and storage, refer to IOPS in Azure Database for MySQL Flexible Server.
The resource ID of the primary keyvault key for data encryption.
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
Mode of import. Enum values: [Offline, Online]. Default is Offline.
This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.
Determines the public access. Enter single or range of IP addresses to be included in the allowed list of IPs. IP address ranges must be dash-separated and not contain any spaces. Specifying 0.0.0.0 allows public access from any resources deployed within Azure to access your server. Setting it to "None" sets the server in public access mode but does not create a firewall rule.
The name of the compute SKU. Follows the convention Standard_{VM name}. Examples: Standard_B1ms.
The availability zone information of the standby server when high availability is enabled.
Enable or disable autogrow of the storage. Default value is Enabled.
The storage capacity of the server. Minimum is 32 GiB and max is 16 TiB.
Name or resource ID of a new or existing subnet. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.
The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Compute tier of the server. Accepted values: Burstable, GeneralPurpose, MemoryOptimized.
Server major version.
Name or ID of a new or existing virtual network. This parameter only applies if you are creating cross region replica server with private access. For in-region read replica with private access, source server settings are carried over and this parameter is ignored. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
Do not prompt for confirmation.
Availability zone into which to provision the resource.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az mysql flexible-server import stop-replication
To stop replication between the source single server and target flexible server.
az mysql flexible-server import stop-replication [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
Examples
Stop replication to 'testFlexServer'.
az mysql flexible-server import stop-replication -g testGroup -n testFlexServer
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI