< Back

Restore-GcSqlInstanceBackup

Mon Jan 13, 2020 11:48 pm

NAME Restore-GcSqlInstanceBackup



SYNOPSIS

Restores a backup of a Cloud SQL Instance.





SYNTAX

Restore-GcSqlInstanceBackup [-Project <string>] [-BackupRunId] <long> [-Instance] <string> [-BackupInstance

<string>] [<CommonParameters>]



Restore-GcSqlInstanceBackup [-BackupRunId] <long> -InstanceObject <DatabaseInstance> [-BackupInstance <string>]

[<CommonParameters>]





DESCRIPTION

Restores the specified backup of the specified Cloud SQL Instance.



If a BackupInstance is specified, it will restore the specified backup run of that instance to the specified

Instance. Otherwise, it will assume the backup instance is the same as the specified Instance.



If a Project is specified, it will restore the specified backup in that project. Otherwise, restores the backup in

the Cloud SDK config project.





PARAMETERS

-Project <string>

Name of the project in which the instances to backup to and from reside. Defaults to the Cloud SDK config for

properties if not specified.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-BackupRunId <long>

The id of the BackupRun to restore to.



Required? true

Position? 0

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Instance <string>

The name/ID of Instance we are restoring the backup to.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InstanceObject <DatabaseInstance>

The DatabaseInstance that describes the Instance we are restoring the backup to.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-BackupInstance <string>

The name/ID of Instance we are backing up from.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Google.Apis.SQLAdmin.v1beta4.Data.DatabaseInstance

The DatabaseInstance that describes the Instance we are restoring the backup to.





OUTPUTS



---------- EXAMPLE 1 ----------



PS C:\\> Restore-GcSqlInstanceBackup -Project "testing" -BackupRunId 1243244 -Instance "testRepl1"



Restores backup run with id 0 of the SQL Instance "testRepl1" from the Project "testing" to the same SQL Instance.

---------- EXAMPLE 2 ----------



PS C:\\> Restore-GcSqlInstanceBackup -Project "testing" -BackupRunId 0 -Instance "testRepl1" `

-BackupInstance "testRepl2"



Restores backup run with id 0 of the SQL Instance "testRepl2" from the Project "testing" to the SQL Instance

"testRepl1" (which must be in the same project).



RELATED LINKS

[Managing Backups] (https://cloud.google.com/tools/powershe ... sql/backup)

[Overview of Backups] (https://cloud.google.com/sql/docs/backu ... ry/backups)

[Overview of Restoring an instance] (https://cloud.google.com/sql/docs/backu ... ry/restore)