Cloning instances

This page explains cloning, and describes how to clone an instance.

When you clone a Cloud SQL instance, you create a new instance that is a copy of the source instance, but is completely independent. After cloning is complete, changes to the source instance are not reflected in the clone, and changes in the clone are not reflected in the source instance.

The source instance configuration (activation policy, database flags, connectivity, and so on) is copied to the clone. Instance IP addresses and replicas are not copied; you must configure these items explicitly on the clone. Cloning an instance does not clone any existing backups.

You cannot clone a replica.

You can clone an instance that was cloned from another instance. You can clone an instance from an earlier point in time, which helps you recover your database from a destructive event. For more information, see Performing a point-in-time recovery

Cloning an instance


  1. Go to the Cloud SQL Instances page in the Google Cloud Console.

    Go to the Cloud SQL Instances page

  2. Find the row of the instance to clone. At the right end of the row, click the More Actions menu.
  3. Click Create clone.
  4. 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.


Clone the instance:

gcloud sql instances clone [SOURCE_INSTANCE_NAME] [TARGET_INSTANCE_NAME]


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:


Request JSON body:

    "destinationInstanceName": "target-instance-id"

To send your request, expand one of these options:

You should receive a JSON response similar to the following:


Click the links in the table for details:

For this problem... The issue might be... Try this...
Cloning fails with constraints/sql.restrictAuthorizedNetworks error. Blocked by Authorized Networks configuration. Try one of these options.

Cloning fails with a constraints/sql.restrictAuthorizedNetworks error

Cloning fails with a constraints/sql.restrictAuthorizedNetworks error.

The issue might be

The cloning operation is blocked by the Authorized Networks configuration. Authorized Networks are configured for public IP addresses in the Connectivity section of the Google Cloud Console, and cloning is not permitted due to security considerations.

Things to try

Remove all Authorized Networks entries from the Cloud SQL instance if you can. Otherwise, create a replica without any Authorized Networks entries.