> [!NOTE]
> **Note:** This page contains features related to Cloud SQL editions. For more information about Cloud SQL editions, see [Introduction to Cloud SQL editions](https://docs.cloud.google.com/sql/docs/mysql/editions-intro).

<br />

This page shows you how to use the in-place upgrade method to upgrade a Cloud SQL Enterprise edition
instance to Cloud SQL Enterprise Plus edition. Additionally, it also describes the procedure to
switch a Cloud SQL Enterprise Plus edition instance to Cloud SQL Enterprise edition.

Upgrading to Cloud SQL Enterprise Plus edition provides you with several benefits and performance enhancements.
For more information, see [Introduction to Cloud SQL for SQL Server editions](https://docs.cloud.google.com/sql/docs/sqlserver/editions-intro).

To enable these enhancements for your existing Cloud SQL Enterprise edition instances, you must upgrade
them to Cloud SQL Enterprise Plus edition. The upgrade process takes a few minutes to complete

Additionally, this upgrade process doesn't require you to change the endpoints
that your applications connect to.

## Before you begin

- Ensure that you're running a Cloud SQL Enterprise edition instance on SQL Server Enterprise 2019 or SQL Server Enterprise 2022.

  > [!NOTE]
  > **Note:** If you set the [`max server memory (mb)`](https://docs.cloud.google.com/sql/docs/sqlserver/flags) flag, then we suggest removing the flag after you upgrade your instance to Cloud SQL Enterprise Plus edition. This way, Cloud SQL can manage the value for the flag automatically. However, if you prefer to set the value, you can revisit the flag value after you upgrade your instance and adjust the value according to the size of the VM.

- Ensure that your network project is created after August 2021 or is fully [upgraded](https://docs.cloud.google.com/sql/docs/sqlserver/upgrade-cloud-sql-instance-new-network-architecture) to the new network architecture.

## Upgrade an instance to Cloud SQL Enterprise Plus edition

Use the procedure in this section to upgrade a Cloud SQL Enterprise edition instance
to Cloud SQL Enterprise Plus edition.

### Console

1. In the Google Cloud console, go to the **Cloud SQL Instances** page.

   [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)
2. To open the **Overview** page of an instance, click the instance name.
3. Click **Edit**.
4. In the **Choose a Cloud SQL edition** section, click **Upgrade**.
5. In the **Upgrade to Enterprise Plus** panel, enter your instance ID and then click **Upgrade edition**.


Alternatively, you can also upgrade an instance by clicking **Upgrade** in the
**Configuration** section of the instance **Overview** page.

### gcloud

The following code sample shows how to upgrade your instance to Cloud SQL Enterprise Plus edition:

```bash
gcloud sql instances patch INSTANCE_ID \
  --edition=enterprise-plus \
  --tier=MACHINE_TYPE \
  --project=PROJECT_ID
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID of the instance that you want to upgrade.
- <var translate="no">INSTANCE_ID</var>: name of the instance that you want to upgrade.
- <var translate="no">MACHINE_TYPE</var>: the machine type of the instance that you want to upgrade to. For more information about machine types for Cloud SQL Enterprise Plus edition, see [Machine types for Cloud SQL Enterprise Plus edition instances](https://docs.cloud.google.com/sql/docs/sqlserver/create-instance#enterprise-plus).

### REST

The following command upgrades your instance to Cloud SQL Enterprise edition and triggers a restart operation.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the project ID of the instance that you want to upgrade.
- <var translate="no">INSTANCE_ID</var>: the instance ID of the instance that you want to upgrade.
- <var translate="no">MACHINE_TYPE</var>: the machine type of the instance that you want to upgrade to. For more information about machine types for Cloud SQL Enterprise Plus edition, see [Machine types for Cloud SQL Enterprise Plus edition instances](https://docs.cloud.google.com/sql/docs/sqlserver/create-instance#enterprise-plus).


HTTP method and URL:

```
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID
```


Request JSON body:

```
{
  "settings": {
      "tier": "MACHINE_TYPE",
      "edition": "ENTERPRISE_PLUS",
      "dataCacheConfig": {
        "dataCacheEnabled": true
      },
  }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
```

You should receive a JSON response similar to the following:

```
{
  "kind": "sql#operation",
  "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID",
  "status": "PENDING",
  "user": "user@example.com",
  "insertTime": "2020-01-16T02:32:12.281Z",
  "operationType": "UPDATE",
  "name": "OPERATION_ID",
  "targetId": "INSTANCE_ID",
  "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/operations/OPERATION_ID",
  "targetProject": "PROJECT_ID"
}
```

### REST v1beta4

The following command upgrades your instance to Cloud SQL Enterprise edition and triggers a restart operation.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the project ID of the instance that you want to upgrade.
- <var translate="no">INSTANCE_ID</var>: the instance ID of the instance that you want to upgrade.
- <var translate="no">MACHINE_TYPE</var>: the machine type of the instance that you want to upgrade to. For more information about machine types for Cloud SQL Enterprise Plus edition, see [Machine types for Cloud SQL Enterprise Plus edition instances](https://docs.cloud.google.com/sql/docs/sqlserver/create-instance#enterprise-plus).


HTTP method and URL:

```
PATCH https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID
```


Request JSON body:

```
{
  "settings": {
      "tier": "MACHINE_TYPE",
      "edition": "ENTERPRISE_PLUS",
      "dataCacheConfig": {
        "dataCacheEnabled": true
      },
  }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
```

You should receive a JSON response similar to the following:

```
{
  "kind": "sql#operation",
  "targetLink": "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID",
  "status": "PENDING",
  "user": "user@example.com",
  "insertTime": "2020-01-16T02:32:12.281Z",
  "operationType": "UPDATE",
  "name": "OPERATION_ID",
  "targetId": "INSTANCE_ID",
  "selfLink": "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/operations/OPERATION_ID",
  "targetProject": "PROJECT_ID"
}
```

## Change to Cloud SQL Enterprise edition

> [!NOTE]
> **Note**: Cloud SQL disables the data cache automatically when you change an instance from Cloud SQL Enterprise Plus edition to Cloud SQL Enterprise edition.

### Console

1. In the Google Cloud console, go to the **Cloud SQL Instances** page.

   [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)
2. To open the **Overview** page of an instance, click the instance name.
3. Click **Edit**.
4. In the **Choose a Cloud SQL edition** section, click **Switch to Enterprise**.
5. In the **Switch to Enterprise** panel, enter your instance ID and then click **Switch edition**.


Alternatively, you can also change to Cloud SQL Enterprise edition by clicking **Switch to Enterprise** in **Configuration** section
of the instance **Overview** page.

### gcloud

The following code sample shows how to change your instance to Cloud SQL Enterprise edition:

```bash
gcloud sql instances patch INSTANCE_ID \
  --edition=enterprise \
  --tier=MACHINE_TYPE \
  --project=PROJECT_ID
```
Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID of the instance.
- <var translate="no">INSTANCE_ID</var>: name of the instance.
- <var translate="no">MACHINE_TYPE</var>: the machine type of the instance that you want to switch to. For more information about machine types for Cloud SQL Enterprise edition, see [Machine types for Cloud SQL Enterprise edition instances](https://docs.cloud.google.com/sql/docs/sqlserver/create-instance#enterprise).

### REST

The following command changes your instance to Cloud SQL Enterprise edition and triggers a restart operation.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the project ID of the instance.
- <var translate="no">INSTANCE_ID</var>: the instance ID of the instance.
- <var translate="no">MACHINE_TYPE</var>: the machine type of the instance that you want to switch to. For more information about machine types for Cloud SQL Enterprise edition, see [Machine types for Cloud SQL Enterprise edition instances](https://docs.cloud.google.com/sql/docs/sqlserver/create-instance#enterprise).


HTTP method and URL:

```
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID
```


Request JSON body:

```
{
  "settings": {
      "tier": "MACHINE_TYPE",
      "edition": "ENTERPRISE"
  }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
```

You should receive a JSON response similar to the following:

```
{
  "kind": "sql#operation",
  "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/instances/INSTANCE_ID",
  "status": "PENDING",
  "user": "user@example.com",
  "insertTime": "2020-01-16T02:32:12.281Z",
  "operationType": "UPDATE",
  "name": "OPERATION_ID",
  "targetId": "INSTANCE_ID",
  "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT_ID/operations/OPERATION_ID",
  "targetProject": "PROJECT_ID"
}
```

### REST v1beta4

The following command changes your instance to Cloud SQL Enterprise edition and triggers a restart operation.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the project ID of the instance.
- <var translate="no">INSTANCE_ID</var>: the instance ID of the instance.
- <var translate="no">MACHINE_TYPE</var>: the machine type of the instance that you want to switch to. For more information about machine types for Cloud SQL Enterprise edition, see [Machine types for Cloud SQL Enterprise edition instances](https://docs.cloud.google.com/sql/docs/sqlserver/create-instance#enterprise).


HTTP method and URL:

```
PATCH https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID
```


Request JSON body:

```
{
  "settings": {
      "tier": "MACHINE_TYPE",
      "edition": "ENTERPRISE"
  }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID" | Select-Object -Expand Content
```

You should receive a JSON response similar to the following:

```
{
  "kind": "sql#operation",
  "targetLink": "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/instances/INSTANCE_ID",
  "status": "PENDING",
  "user": "user@example.com",
  "insertTime": "2020-01-16T02:32:12.281Z",
  "operationType": "UPDATE",
  "name": "OPERATION_ID",
  "targetId": "INSTANCE_ID",
  "selfLink": "https://sqladmin.googleapis.com/v1beta4/projects/PROJECT_ID/operations/OPERATION_ID",
  "targetProject": "PROJECT_ID"
}
```

## Generate the write endpoint automatically

A *write endpoint* is a global domain name service (DNS) name that resolves to
the IP address of the current primary Cloud SQL instance automatically.
This endpoint redirects incoming connections to the new primary instance
automatically in case of a replica [failover](https://docs.cloud.google.com/sql/docs/sqlserver/replication/cross-region-replicas) operation.
You can use the write endpoint in a SQL
connection string instead of an IP address. By using a write endpoint, you can
avoid having to make application connection changes when a region outage occurs.

If you [enable the DNS API](https://docs.cloud.google.com/sql/docs/sqlserver/configure-private-ip#connect-write-endpoint) for your
Google Cloud project and upgrade your instance that has a private IP address on the new network
architecture to Cloud SQL Enterprise Plus edition, then Cloud SQL generates the write endpoint

automatically for you. However, the [server certificate](https://docs.cloud.google.com/sql/docs/sqlserver/configure-ssl-instance) that's associated with
the instance won't have the write endpoint (global DNS name) added to it. Therefore, if you want to
verify the DNS name, then you must [rotate the certificate](https://docs.cloud.google.com/sql/docs/sqlserver/manage-ssl-instance#manage-server-certs). After the rotation of this certificate
is complete, Cloud SQL adds the DNS name to the certificate. You can
use the DNS name for server identity verification.


## What's next

- Learn more about [Cloud SQL Enterprise Plus edition](https://docs.cloud.google.com/sql/docs/editions-intro).