Restore-AzMySqlServer
Restore a server from an existing backup
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Restore-AzMySqlServer
-Name <String>
-ResourceGroupName <String>
-InputObject <IServer>
-UseGeoRestore
[-SubscriptionId <String>]
[-Location <String>]
[-Sku <String>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Restore-AzMySqlServer
-Name <String>
-ResourceGroupName <String>
-InputObject <IServer>
-RestorePointInTime <DateTime>
-UsePointInTimeRestore
[-SubscriptionId <String>]
[-Location <String>]
[-Sku <String>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
Restore a server from an existing backup
Examples
Example 1: Restore MySql server using GeoReplica Restore
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test-replica | Restore-AzMySqlServer -Name mysql-test -ResourceGroupName PowershellMySqlTest -UseGeoRestore
Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
---- -------- ------------------ ------- ----------------------- ------- ------- --------------
mysql-test-11 eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
This cmdlet restores MySql server using GeoReplica Restore.
Example 2: Restore MySql server using PointInTime Restore
PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
PS C:\> Get-AzMySqlServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -UsePointInTimeRestore
Name Location AdministratorLogin Version StorageProfileStorageMb SkuName SkuTier SslEnforcement
---- -------- ------------------ ------- ----------------------- ------- ------- --------------
mysql-test-restore eastus mysql_test 5.7 10240 GP_Gen5_4 GeneralPurpose Disabled
These cmdlets restore MySql server using PointInTime Restore.
Parameters
Run the command as a job.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | PSObject |
| Aliases: | AzureRMContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The source server object to restore from. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
| Type: | IServer |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The location the resource resides in.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the server.
| Type: | String |
| Aliases: | ServerName |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Run the command asynchronously.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the resource group that contains the resource, You can obtain this value from the Azure Resource Manager API or the portal.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The location the resource resides in.
| Type: | DateTime |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The subscription ID that identifies an Azure subscription.
| Type: | String |
| Position: | Named |
| Default value: | (Get-AzContext).Subscription.Id |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Application-specific metadata in the form of key-value pairs.
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Use Geo mode to restore
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Use PointInTime mode to restore
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Outputs
Notes
ALIASES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The source server object to restore from.
Location <String>: The geo-location where the resource lives[Tag <ITrackedResourceTags>]: Resource tags.[(Any) <String>]: This indicates any property can be added to this object.
[AdministratorLogin <String>]: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).[EarliestRestoreDate <DateTime?>]: Earliest restore point creation time (ISO8601 format)[FullyQualifiedDomainName <String>]: The fully qualified domain name of a server.[IdentityType <IdentityType?>]: The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.[InfrastructureEncryption <InfrastructureEncryption?>]: Status showing whether the server enabled infrastructure encryption.[MasterServerId <String>]: The master server id of a replica server.[MinimalTlsVersion <MinimalTlsVersionEnum?>]: Enforce a minimal Tls version for the server.[PublicNetworkAccess <PublicNetworkAccessEnum?>]: Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'[ReplicaCapacity <Int32?>]: The maximum number of replicas that a master server can have.[ReplicationRole <String>]: The replication role of the server.[SkuCapacity <Int32?>]: The scale up/out capacity, representing server's compute units.[SkuFamily <String>]: The family of hardware.[SkuName <String>]: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.[SkuSize <String>]: The size code, to be interpreted by resource as appropriate.[SkuTier <SkuTier?>]: The tier of the particular SKU, e.g. Basic.[SslEnforcement <SslEnforcementEnum?>]: Enable ssl enforcement or not when connect to server.[StorageProfileBackupRetentionDay <Int32?>]: Backup retention days for the server.[StorageProfileGeoRedundantBackup <GeoRedundantBackup?>]: Enable Geo-redundant or not for server backup.[StorageProfileStorageAutogrow <StorageAutogrow?>]: Enable Storage Auto Grow.[StorageProfileStorageMb <Int32?>]: Max storage allowed for a server.[UserVisibleState <ServerState?>]: A state of a server that is visible to user.[Version <ServerVersion?>]: Server version.