แชร์ผ่าน


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

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

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

Data source type. e.g., mysql_single: Azure Database for MySQL Servers. azure_blob: Source backup provided in Azure blob container.

Accepted values: azure_blob, mysql_single
--name -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--address-prefixes

The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.

--admin-password -p

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.

--admin-user -u

Administrator username for the server. Once set, it cannot be changed.

--auto-scale-iops

Enable or disable the auto scale iops. Default value is Disabled.

Accepted values: Disabled, Enabled
Default value: Disabled
--backup-identity

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.

--backup-key

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.

--backup-retention

The number of days a backup is retained. Range of 1 to 35 days. Default is 7 days.

--data-source-backup-dir

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.

--data-source-sas-token

Sas token for accessing the data source. This parameter is valid for storage based data source. Example: azure_blob.

--geo-redundant-backup

Whether or not geo redundant backup is enabled.

Accepted values: Disabled, Enabled
--high-availability

Enable (ZoneRedundant or SameZone) or disable high availability feature.

Accepted values: Disabled, SameZone, ZoneRedundant
Default value: Disabled
--identity

The name or resource ID of the user assigned identity for data encryption.

--iops

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.

--key

The resource ID of the primary keyvault key for data encryption.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--mode

Mode of import. Enum values: [Offline, Online]. Default is Offline.

Accepted values: Offline, Online
Default value: Offline
--private-dns-zone

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.

--public-access

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.

--sku-name

The name of the compute SKU. Follows the convention Standard_{VM name}. Examples: Standard_B1ms.

--standby-zone

The availability zone information of the standby server when high availability is enabled.

--storage-auto-grow

Enable or disable autogrow of the storage. Default value is Enabled.

Accepted values: Disabled, Enabled
--storage-size

The storage capacity of the server. Minimum is 32 GiB and max is 16 TiB.

--subnet

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.

--subnet-prefixes

The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--tier

Compute tier of the server. Accepted values: Burstable, GeneralPurpose, MemoryOptimized.

--version

Server major version.

--vnet

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.

--yes -y

Do not prompt for confirmation.

Default value: False
--zone -z

Availability zone into which to provision the resource.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

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

--ids

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 -n

Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.