Create and configure your destination Cloud SQL instance
Stay organized with collections
Save and categorize content based on your preferences.
For heterogeneous SQL Server migrations to Cloud SQL,
Database Migration Service requires that you first create and configure your
Cloud SQL destination instance. Perform the following steps:
Create your destination instance. Make sure you configure enough compute
and memory resources to cover your migration needs and follow the requirements
listed in
known limitations.
We recommend that you create your destination instance with settings
specific to the
destination networking method you want to use:
Determine if you can use a PSC-enabled Cloud SQL instance as your
migration destination. Carefully consider functionality limitations
for PSC-enabled instances. See
Private Service Connect limitations
in the Cloud SQL documentation.
For scenarios where you can use a PSC-enabled Cloud SQL instance,
create your destination instance with both private IP and
Private Service Connect enabled. See
Create a PSC-enabled Cloud SQL instance in the
Cloud SQL for PostgreSQL documentation.
For scenarios where you can't use a PSC-enabled Cloud SQL instance,
create your destination instance with private IP enabled. See
Create a Cloud SQL instance with private IP enabled in
the Cloud SQL for PostgreSQL documentation.
Create the following entities in your destination instance:
Optional: Grant your migration user the CREATEDB
permission for the purposes of testing converted schema.
At a later point in the migration, after you
convert the source schema, you can use Database Migration Service
to test whether converted schema can be applied to a PostgreSQL
database. To perform the test, Database Migration Service creates a temporary
database to avoid impacting your destination database.
If you want to
test your converted schema,
grant your migration user the CREATEDB permission.
Use the following command:
For source databases that contain foreign keys or triggers:
Skip replication for foreign keys and triggers by using the
REPLICATION option with the dedicated migration
user account. Run the following command:
[[["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-08-29 UTC."],[[["\u003cp\u003eDatabase Migration Service facilitates heterogeneous migrations from SQL Server to Cloud SQL for PostgreSQL, but is currently a pre-GA feature with limited support.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting the migration, you must first create and configure your Cloud SQL destination instance, ensuring adequate resources and adherence to known limitations.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating the destination instance, you need to select the appropriate networking method, either public or private IP, based on your requirements.\u003c/p\u003e\n"],["\u003cp\u003eA dedicated migration user account, named the same as the destination database, must be created and granted specific permissions like \u003ccode\u003eCREATE\u003c/code\u003e, \u003ccode\u003eSELECT\u003c/code\u003e, \u003ccode\u003eINSERT\u003c/code\u003e, \u003ccode\u003eUPDATE\u003c/code\u003e, \u003ccode\u003eDELETE\u003c/code\u003e, and \u003ccode\u003eTRUNCATE\u003c/code\u003e on the target schema.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, the migration user can be granted the \u003ccode\u003eCREATEDB\u003c/code\u003e permission for testing converted schemas and the \u003ccode\u003eREPLICATION\u003c/code\u003e option should be used for source databases with foreign keys or triggers to skip replication for those elements.\u003c/p\u003e\n"]]],[],null,["# Create and configure your destination Cloud SQL instance\n\nFor heterogeneous SQL Server migrations to Cloud SQL,\nDatabase Migration Service requires that you first create and configure your\nCloud SQL destination instance. Perform the following steps:\n\n1. Create your destination instance. Make sure you configure enough compute and memory resources to cover your migration needs and follow the requirements listed in [known limitations](/database-migration/docs/sqlserver-to-csql-pgsql/known-limitations). **Note:** If you're migrating from a Cloud SQL for SQL Server instance, create the destination instance in the same region as your source.\n\n We recommend that you create your destination instance with settings\n specific to the\n [destination networking method](/database-migration/docs/sqlserver-to-csql-pgsql/networking-methods-destination) you want to use:\n\n2. Create the following entities in your destination instance:\n - A [database to migrate your data](/sql/docs/postgres/create-manage-databases).\n - A [dedicated migration user account](/sql/docs/postgres/create-manage-users#creating).\n3. Grant the required permissions to the dedicated migration user account. Do the following:\n 1. Connect to your Cloud SQL instance with a SQL client. You can use the following methods:\n - [`psql` client](/sql/docs/postgres/connect-admin-ip). You can use this method to connect to your instance private IP, but it might require that you create a Compute Engine virtual machine.\n - [`gcloud sql connect`](/sdk/gcloud/reference/sql/connect) command. This command works only for Cloud SQL instances that have a public IP address enabled.\n 2. Run the following command on your destination instance: \n\n ```sql\n GRANT CREATE ON DATABASE DESTINATION_DB_NAME TO \"\u003cvar translate=\"no\"\u003eMIGRATION_USER_ACCOUNT_NAME\u003c/var\u003e\";\n ```\n 3. Optional: Grant your migration user the `CREATEDB`\n permission for the purposes of testing converted schema.\n\n At a later point in the migration, after you\n [convert the source schema](/database-migration/docs/sqlserver-to-csql-pgsql/convert-sql), you can use Database Migration Service\n to test whether converted schema can be applied to a PostgreSQL\n database. To perform the test, Database Migration Service creates a temporary\n database to avoid impacting your destination database.\n If you want to\n [test your converted schema](/database-migration/docs/sqlserver-to-csql-pgsql/work-with-conversion-workspaces#test-apply-to-dest),\n grant your migration user the `CREATEDB` permission.\n Use the following command: \n\n ```sql\n ALTER USER \"\u003cvar translate=\"no\"\u003eMIGRATION_USER_ACCOUNT_NAME\u003c/var\u003e\" WITH CREATEDB;\n ```\n 4. **For source databases that contain foreign keys or triggers** : Skip replication for foreign keys and triggers by using the [`REPLICATION`](https://www.postgresql.org/docs/current/role-attributes.html#id-1.6.9.6.2.1.5.1.1) option with the dedicated migration user account. Run the following command: \n\n ```sql\n ALTER USER \"\u003cvar translate=\"no\"\u003eMIGRATION_USER_ACCOUNT_NAME\u003c/var\u003e\" WITH REPLICATION;\n ```\n\n For more information about how Database Migration Service migrates foreign keys\n and triggers, see\n [Considerations for foreign keys and triggers](/database-migration/docs/sqlserver-to-csql-pgsql/known-limitations#foreign-keys-triggers-considerations).\n\nWhat's next?\n------------\n\n- Learn about destination database network connectivity. See\n [Destination database networking methods](/database-migration/docs/sqlserver-to-csql-pgsql/networking-methods-destination).\n\n- Learn about migration jobs. See [Create a migration job](/database-migration/docs/sqlserver-to-csql-pgsql/create-migration-job)\n\n- To get a complete, step-by-step migration walkthrough, see\n [SQL Server to Cloud SQL for PostgreSQL migration guide](/database-migration/docs/sqlserver-to-csql-pgsql/guide)."]]