This page explains cloning, and describes how to clone an instance.
Overview
Cloning a Cloud SQL instance creates a new instance that is a copy of the source instance. The new instance is completely independent from the source instance.
Frequently asked questions
Question | Answer |
---|---|
Does cloning impact performance? | No. Cloning has no performance impact on the source instance. |
Are backups copied to the new instance? | No. The new instance creates new automated backups. Manual backups are not copied over from the source instance. |
Does the new instance have the same IP address or addresses? | No. The new instance has a new IP address or addresses. |
Does the new instance have the same configuration settings? | Yes. The new instance will have the same settings such as database flags, connectivity options, machine type, and storage and memory settings. |
Can you clone an instance that was once a clone? | Yes. You can clone and instance that was cloned from another instance. |
Cloning an instance
Console
- Go to the Cloud SQL Instances page in the Google Cloud Console.
- Find the row of the instance to clone. At the right end of the row, click the More Actions menu.
- Click Create clone.
- On the Create a clone page, update the instance ID if needed, and
click Create clone.
You are returned to the instance listing page while the clone initializes.
gcloud
Clone the instance:
gcloud sql instances clone [SOURCE_INSTANCE_NAME] [TARGET_INSTANCE_NAME]
REST v1beta4
Clone the instance.
Before using any of the request data below, make the following replacements:
- project-id: The project ID
- source-instance-id: The source instance ID
- target-instance-id: The target instance ID
HTTP method and URL:
POST https://www.googleapis.com/sql/v1beta4/projects/project-id/instances/source-instance-id/clone
Request JSON body:
{ "cloneContext": { "destinationInstanceName": "target-instance-id" } }
To send your request, expand one of these options:
You should receive a JSON response similar to the following: