Reputation: 164
Here is the restore code I ran:
gcloud sql backups restore 1588287600000 --restore-instance=newinstance \
--backup-instance=backupinstance
I am trying to restore a cloud sql backup from another instance to a new instance I crreated but I end up with this error
(gcloud.sql.backups.restore) HTTPError 400: This operation isn"t valid for this instance.
Upvotes: 0
Views: 2226
Reputation: 164
So basically I made sure the new instance has the same configurations as the backup instance in the process of creatinge.g memory, storage-size, cpu and also set the root-password to none. more on restore requirments https://cloud.google.com/sql/docs/mysql/backup-recovery/restore#tips-restore
gcloud sql instances create $TARGET_INSTANCE_NAME --root-password="" --memory=$MEMORY"GB" --storage-size=$SIZE --cpu=$CPU --database-version="MYSQL_5_6" --zone=us-central1-a
# #
# # Restor backup from backup instance to new instance
#
gcloud beta sql backups restore $BACKUP_ID --restore-instance=$TARGET_INSTANCE_NAME --backup-instance=$SOURCE_INSTANCE_NAME
Upvotes: 2