Stay organized with collections Save and categorize content based on your preferences.
MySQL | PostgreSQL | SQL Server Note: This page contains features related to Cloud SQL editions. For more information about Cloud SQL editions, see Introduction to Cloud SQL editions.This page shows you how to use the private VPC peering network connectivity method of Database Migration Service to upgrade a Cloud SQL Enterprise edition instance to Cloud SQL Enterprise Plus edition. Database Migration Service creates a new Cloud SQL instance and migrates data to that instance.
OverviewCloud SQL Enterprise Plus edition is ideal for applications that require maximum write performance. For more information about these improvements, see Performance enhancements.
To enable these enhancements for your existing Cloud SQL Enterprise edition instances, you must upgrade them to Cloud SQL Enterprise Plus edition using Database Migration Service.
Before you beginIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Make sure that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Make sure that billing is enabled for your Google Cloud project.
Database Migration Service offers various source database options and network connectivity methods. Different sources work better with some connectivity methods than with others. On this page, we assume that you're using a Cloud SQL Enterprise edition instance in an environment where you can configure your network to add an inbound firewall rule. Because we can't know the specifics of your environment, we can't provide detailed steps when it comes to your networking configuration.
Configure your source instanceTo configure your source Cloud SQL Enterprise edition instance, complete the following steps:
postgres
database for your source instance, then create one. For more information, see Create a database on the Cloud SQL instance.pglogical
package on the databases of your source instance. Make sure that the package is included in the shared_preload_libraries
variable. For more information, see Configure your source databases.Note: For PostgreSQL 9.4, install the pglogical_origin
extension. Then, install the extension on every database by running the following commands:
CREATE EXTENSION IF NOT EXISTS pglogical_origin;
CREATE EXTENSION IF NOT EXISTS pglogical;
Aside from the template0
and template1
databases, Database Migration Service migrates every other database under your source Cloud SQL Enterprise edition instance.
On each database in your source instance that isn't mentioned above, complete the following steps:
To install the pglogical
extension into the database, run the CREATE EXTENSION IF NOT EXISTS pglogical
command.
For any tables that don't have primary keys, migrate the UPDATE
and DELETE
statements manually.
Note: For tables that don't have primary keys, Database Migration Service supports migration of the initial snapshot and INSERT
statements during the change data capture (CDC) phase.
To learn how to generate a query to list tables in a PostgreSQL database without primary keys, see Debugging and other tools. For each database table that you find that doesn't have a primary key and the table isn't part of the databases that aren't migrated, alter the table so that it has a primary key or migrate the UPDATE
and DELETE
operations for the table. For tables that don't have primary keys, only the initial snapshot and INSERT
statements are migrated.
To set these privileges on each of the migrated databases, create a user or set the privileges of an existing user. You use this user to connect to the source instance, and you configure this user as the user in the Connection profiles page. This user must have certain privileges on each of the migrated databases, as well as the default postgres
database.
To set these privileges, connect to the instance and run the following commands:
GRANT USAGE on SCHEMA SCHEMA to USER
on all schemas (aside from the information schema and schemas starting with pg_
) on each database that you want to migrate.GRANT USAGE on SCHEMA pglogical to PUBLIC;
on each database that you want to migrate.GRANT SELECT on ALL TABLES in SCHEMA pglogical to USER
on all databases to get replication information from source databases.GRANT SELECT on ALL TABLES in SCHEMA SCHEMA to USER
on all schemas (aside from the information schema and schemas starting with pg_
) on each database that you want to migrate.GRANT SELECT on ALL SEQUENCES in SCHEMA SCHEMA to USER
on all schemas (aside from the information schema and schemas starting with pg_
) on each database that you want to migrate.ALTER USER USER with REPLICATION role
Enable logical replication and decoding for the databases of your source Cloud SQL Enterprise edition instance by setting the cloudsql.logical_decoding
and cloudsql.enable_pglogical
flags to On
. For more information about these flags, see Configure database flags.
To enable both of these flags, complete the following steps:
In the Google Cloud console, go to the Cloud SQL Instances page.
Expand the Flags section.
To set the cloudsql.logical_decoding
and cloudsql.enable_pglogical
flags, complete the following steps:
cloudsql.logical_decoding
flag.On
.cloudsql.enable_pglogical
flag.Click Save.
In the Changes require restart dialog, click Save and restart. Cloud SQL restarts your source instance so that the configuration changes that you made to the flags can take effect.
To upgrade a source Cloud SQL Enterprise edition instance, you must retrieve the following information:
To retrieve information from the source Cloud SQL Enterprise edition instance, complete the following steps:
In the Google Cloud console, go to the SQL Instances page.
A connection profile contains information about the source Cloud SQL Enterprise edition database. Database Migration Service uses the information in the connection profile to migrate data from your source database to the destination Cloud SQL Enterprise Plus edition instance.
To create a connection profile, complete the following steps:
In the Google Cloud console, go to the Connection profiles page in Database Migration Service.
Click Create profile.
From the Database engine drop-down list, select Cloud SQL for PostgreSQL.
In the Connection profile name field, enter a name for the connection profile for your source database, such as My Connection Profile
.
Select the region where you want to save the connection profile.
Note: Connection profiles, like all resources, are saved in a region. Region selection doesn't affect which migration jobs can use connection profiles, or which regions can connect to the data location. But region selection can affect availability in the case of regional downtime.From the Cloud SQL instance drop-down list, select the name of your Cloud SQL Enterprise edition instance.
In the Hostname or IP address field, replace the value with the private IP address that you copied in Retrieve information from the source Cloud SQL Enterprise edition instance.
To authenticate to your source instance, enter a username and password. Then, click Continue.
Note: Cloud SQL populates the Port field automatically with information about your source instance. If this field is empty, then enter the appropriate port number.If you want to encrypt your data, then enable SSL/TLS encryption for the connection between the source and destination databases. Otherwise keep the default value of None.
Click Continue.
From the Connectivity test drop-down menu, select Not defined.
Click Create.
Database Migration Service uses migration jobs to migrate data from your source Cloud SQL Enterprise edition database instance to the destination Cloud SQL Enterprise Plus edition instance.
Creating a migration job includes the following steps:
In the Google Cloud console, go to the Migration jobs page in Database Migration Service.
Click Create migration job.
In the Migration job name field, enter a name for the migration job, such as My Migration Job
.
From the Source database engine drop-down list, select Cloud SQL for PostgreSQL.
From the Destination database engine drop-down list, select Cloud SQL for PostgreSQL.
Select the destination region where the Cloud SQL Enterprise Plus edition instance is created.
From the Migration job type drop-down list, select Continuous because you want ongoing changes in your source Cloud SQL Enterprise edition database to be migrated to the destination Cloud SQL Enterprise Plus edition instance.
Review the required prerequisites that are generated automatically to reflect how the environment must be prepared for a migration job. These prerequisites can include how to configure the source Cloud SQL Enterprise edition database and how to connect it to the destination Cloud SQL Enterprise Plus edition instance.
It's recommended to complete these prerequisites at this step, but you can complete them at any time before you test or start your migration job.
Click Save & continue.
From the Select source connection profile drop-down list, select the connection profile that you created.
Click Save & continue.
In the Password field, enter an alphanumeric password for the destination Cloud SQL Enterprise Plus edition instance. This is the password for the postgres
administrator account in the instance.
From the Database version drop-down list, select the destination instance from the list of supported Cloud SQL versions for the specified database engine.
Select Enterprise Plus.
From the Choose region and zone section, select the desired Google Cloud zone for the new Cloud SQL Enterprise Plus edition instance (or leave as Any).
Select the Private IP checkbox.
From the VPC drop-down list, select the VPC network that you noted in Retrieve information from the source Cloud SQL Enterprise edition instance.
Select the machine shape for the Cloud SQL Enterprise Plus edition instance. The disk size must be equal to or greater than the source database size.
Define the storage type and storage capacity for the Cloud SQL instance.
To create the new instance, click Create & Continue.
In the dialog that appears, click Create destination & continue. Creating the instance may take several minutes to complete.
Important: This procedure creates a Cloud SQL Enterprise Plus edition instance. You're charged according to the configuration that you select.Review the settings that you chose for the migration job.
Verify that the source has been configured correctly, that the source Cloud SQL Enterprise edition and destination Cloud SQL Enterprise Plus edition instances are able to communicate with each other, and that the migration job is valid:
Click Test job.
Verify that you see the Your migration job test was successful!
status.
If the test fails, then you can address the problem in the appropriate part of the flow, and return to re-test.
To create the migration job and start it immediately, click Create & start job.
In the dialog that appears, click Create & start.
In the Migration jobs page, verify that your migration job has a status of Starting
.
After a few minutes, confirm that the status changes to Running
.
To confirm that Database Migration Service used the migration job to migrate data from your source Cloud SQL Enterprise edition database instance to the destination Cloud SQL Enterprise Plus edition database instance, complete the following steps:
In the Google Cloud console, go to the SQL Instances page.
Click the read replica entry of your migration job.
Note: Make sure that the Cloud SQL edition for this entry is Enterprise Plus, and not Enterprise.At the prompt, to connect to the destination Cloud SQL Enterprise Plus edition database instance, use the gcloud sql connect
command.
gcloud sql connect DESTINATION_INSTANCE_NAME --user=postgres
Replace DESTINATION_INSTANCE_NAME with the name of the destination Cloud SQL Enterprise Plus edition instance.
\list
.\connect SOURCE_DB_NAME
. The name of the prompt changes from postgres
to SOURCE_DB_NAME.\dt
.GRANT cloudsqlexternalsync to USER;
.
Replace USER with the name of the user that you used to connect to the destination Cloud SQL Enterprise Plus edition database instance.
SELECT * from TABLE_NAME;
.Promoting the migration job replaces the source Cloud SQL Enterprise edition database instance with the destination Cloud SQL Enterprise Plus edition database instance as the primary database.
To promote the migration job, complete the following steps:
Return to the Migration jobs page.
Click the migration job that you want to promote. The Migration job details page appears.
Stop all writes to the source Cloud SQL Enterprise edition database.
Important: Before you stop writes to the source database, wait for the replication delay to be minimal. You must stop all writes to this database because, by promoting the migration job, the destination Cloud SQL Enterprise Plus edition database becomes your primary database.Verify that the replication delay is minimal.
Click the migration job that you want to promote. This job has a status of Running
.
To promote the migration job, click Promote.
In the dialog that appears, click Promote.
Verify that the migration job has a status of Promote in progress
. After a few minutes, confirm that the status changes to Completed
.
Your new Cloud SQL Enterprise Plus edition database instance is ready to use.
Clean upTo avoid incurring charges to your Google Cloud account for the resources used on this page, use the Google Cloud console to delete your migration job, connection profile, source Cloud SQL Enterprise edition instance, and project if you don't need them.
What's nextExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4