Restore-AzMySqlFlexibleServer

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-AzMySqlFlexibleServer
       -Name <String>
       -ResourceGroupName <String>
       -InputObject <IServerAutoGenerated>
       -RestorePointInTime <DateTime>
       [-SubscriptionId <String>]
       [-PrivateDnsZone <String>]
       [-Subnet <String>]
       [-Zone <String>]
       [-DefaultProfile <PSObject>]
       [-AsJob]
       [-NoWait]
       [-Confirm]
       [-WhatIf]
       [<CommonParameters>]

Description

Restore a server from an existing backup

Examples

Example 1: Restore MySql server using PointInTime Restore

PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
PS C:\> Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlFlexibleServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime 

Name                 Location  SkuName          SkuTier        AdministratorLogin Version StorageSizeGb
----                 --------  -------          -------        ------------------ ------- -------------
mysql-test-restore   West US 2 Standard_D2ds_v4 GeneralPurpose admin              5.7     32

These cmdlets restore MySql server using PointInTime Restore.

Example 2: Restore MySql server with new private access resources

PS C:\> $restorePointInTime = (Get-Date).AddMinutes(-10)
PS C:\> Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlFlexibleServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -Subnet <SubnetId> -PrivateDnsZone <PrivateDnsZoneId>

Name                 Location  SkuName          SkuTier        AdministratorLogin Version StorageSizeGb
----                 --------  -------          -------        ------------------ ------- -------------
mysql-test-restore   West US 2 Standard_D2ds_v4 GeneralPurpose admin              5.7     32

These cmdlets restore MySql server using PointInTime Restore either from private access server to different private access resources or from public access server to private access server.

Parameters

-AsJob

Run the command as a job.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

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

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

The source server object to restore from. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IServerAutoGenerated
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Name

The name of the server.

Type:String
Aliases:ServerName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NoWait

Run the command asynchronously.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrivateDnsZone

The id of an existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. The suffix of dns zone has to be same as that of fully qualified domain of the server.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

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

The location the resource resides in.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Subnet

The id of an existing Subnet the private access server will created to. Please note that the subnet will be delegated to Microsoft.DBforPostgreSQL/flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SubscriptionId

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

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

Availability zone into which to provision the resource.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IServerAutoGenerated

Outputs

IServerAutoGenerated

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).
  • [AdministratorLoginPassword <SecureString>]: The password of the administrator login (required for server creation).
  • [AvailabilityZone <String>]: availability Zone information of the server.
  • [BackupGeoRedundantBackup <EnableStatusEnum?>]: Whether or not geo redundant backup is enabled.
  • [BackupRetentionDay <Int32?>]: Backup retention days for the server.
  • [CreateMode <CreateMode?>]: The mode to create a new MySQL server.
  • [HighAvailabilityMode <HighAvailabilityMode?>]: High availability mode for a server.
  • [HighAvailabilityStandbyAvailabilityZone <String>]: Availability zone of the standby server.
  • [MaintenanceWindowCustomWindow <String>]: indicates whether custom window is enabled or disabled
  • [MaintenanceWindowDayOfWeek <Int32?>]: day of week for maintenance window
  • [MaintenanceWindowStartHour <Int32?>]: start hour for maintenance window
  • [MaintenanceWindowStartMinute <Int32?>]: start minute for maintenance window
  • [NetworkDelegatedSubnetResourceId <String>]: Delegated subnet resource id used to setup vnet for a server.
  • [NetworkPrivateDnsZoneResourceId <String>]: Private DNS zone resource id.
  • [ReplicationRole <ReplicationRole?>]: The replication role.
  • [RestorePointInTime <DateTime?>]: Restore point creation time (ISO8601 format), specifying the time to restore from.
  • [SkuName <String>]: The name of the sku, e.g. Standard_D32s_v3.
  • [SkuTier <SkuTier?>]: The tier of the particular SKU, e.g. GeneralPurpose.
  • [SourceServerResourceId <String>]: The source MySQL server id.
  • [StorageAutoGrow <EnableStatusEnum?>]: Enable Storage Auto Grow or not.
  • [StorageIop <Int32?>]: Storage IOPS for a server.
  • [StorageSizeGb <Int32?>]: Max storage size allowed for a server.
  • [SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC).
  • [SystemDataCreatedBy <String>]: The identity that created the resource.
  • [SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource.
  • [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC)
  • [SystemDataLastModifiedBy <String>]: The identity that last modified the resource.
  • [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource.
  • [Version <ServerVersion?>]: Server version.