Databases can often have thousands of objects. Converting them all in a single
session might be a challenging process. With conversion workspaces, you can divide
the conversion process into multiple phases where you add new objects to the
conversion, fix the issues, and then test them in your destination database.
Conversion workspaces can produce deterministic conversion results, or enhance
them with
Gemini auto-conversion.
When Gemini auto-conversion is enabled, Database Migration Service
applies auto-conversion augmentations to all your objects every time you convert
the source schema. If you want to use only deterministic conversion rules,
disable Gemini auto-conversion in your workspace.
To convert objects from your source database, do the following:
In the Google Cloud console, go to Conversion workspaces.
From the list of available conversion workspaces, select your workspace.
Conversion workspace editor opens.
Use the SQL Server schema panel to check your source objects for
conversion issues. This panel contains all the objects you pulled from your
schema during
workspace creation.
You can use the interactive SQL editor, upload a conversion mapping file
to convert the object in a specific way, or utilize Gemini-powered
conversion features.
Optional: You can also use the interactive SQL editor to adjust the
converted schema to better meet your needs, even if there are no conversion
issues with your object.
For a list of editable SQL Server objects, see
Supported object types.
After you fix conversion issues or adjust your schema, click
move_downConvert source.
Database Migration Service now analyzes your changes and
generates the updated PostgreSQL schema.
You can inspect the converted schema in the
AlloyDB for PostgreSQL draft tab.
Test the converted schema in your destination database. Do the following:
Click appsApply to destination>Test.
On the Define destination page, use the Destination connection profile
drop-down menu to select your destination connection profile.
Click Define and continue.
On the Select objects and test application page, use the checkboxes to select which
converted PostgreSQL schema you want to apply in your destination database.
Click Test application.
Depending on the test results, you might need to further adjust your
converted schema.
If the schema snapshot you pulled from the source has more objects
that you haven't migrated yet, add these objects to the workspace:
In the SQL Server panel, click
addAdd objects.
The object selection panel opens.
In the schema tree, use the checkboxes to select which objects
you want to add to the conversion and then click Add objects.
Repeat steps 3 through 8 until you convert all the objects that you want
to migrate.
When you finish converting your schema, click
appsApply to destination>Apply.
Database Migration Service now creates the schema definitions in your destination
database.
[[["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\u003eThis document outlines the process of using Database Migration Service to convert SQL Server schemas to AlloyDB for PostgreSQL.\u003c/p\u003e\n"],["\u003cp\u003eConversion workspaces allow you to divide the conversion process into phases, adding new objects, fixing issues, and testing in the destination database incrementally.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves checking for conversion issues, fixing them using the interactive editor, mapping files, or Gemini-assisted features, and adjusting converted schema as needed.\u003c/p\u003e\n"],["\u003cp\u003eAfter converting schema, you can test the changes in your destination database and repeat the process until all desired objects are migrated.\u003c/p\u003e\n"],["\u003cp\u003eOnce the conversion process is complete, you can apply the converted schema to the destination database and prepare for the migration job.\u003c/p\u003e\n"]]],[],null,["# Convert SQL Server code and schema to PostgreSQL syntax\n\nAfter you\n[create your conversion workspace and perform the initial schema conversion](/database-migration/docs/sqlserver-to-alloydb/create-conversion-workspace),\nyou can fix conversion issues, modify your objects with the\ninteractive editor, and apply converted schema to your destination database.\n\nDatabases can often have thousands of objects. Converting them all in a single\nsession might be a challenging process. With conversion workspaces, you can divide\nthe conversion process into multiple phases where you add new objects to the\nconversion, fix the issues, and then test them in your destination database.\n\nConversion workspaces can produce deterministic conversion results, or enhance\nthem with\n[Gemini auto-conversion](/database-migration/docs/sqlserver-to-alloydb/code-conversion-with-gemini#auto-conversion).\nWhen Gemini auto-conversion is enabled, Database Migration Service\napplies auto-conversion augmentations to all your objects every time you convert\nthe source schema. If you want to use only deterministic conversion rules,\ndisable Gemini auto-conversion in your workspace.\n| **Note:** Database Migration Service migrates only tables that have primary keys. If your source database includes tables that don't have primary keys, Database Migration Service conversion workspaces automatically create any missing primary keys in the destination tables when you convert your source code and schema. For more information on data migration for tables without primary keys, see [Source tables without primary keys](/database-migration/docs/sqlserver-to-alloydb/known-limitations#primary-keys-considerations).\n\nTo convert objects from your source database, do the following:\n\n1. In the Google Cloud console, go to **Conversion workspaces** .\n\n [Go to Conversion workspaces](https://console.cloud.google.com/dbmigration/conversion-workspaces)\n2. From the list of available conversion workspaces, select your workspace. Conversion workspace editor opens.\n\n3. Use the **SQL Server** schema panel to check your source objects for conversion issues. This panel contains all the objects you pulled from your schema during [workspace creation](/database-migration/docs/sqlserver-to-alloydb/create-conversion-workspace).\n4. [Fix your conversion issues](/database-migration/docs/sqlserver-to-alloydb/work-with-conversion-workspaces#fix-conversion-issues).\n\n You can use the interactive SQL editor, upload a conversion mapping file\n to convert the object in a specific way, or utilize Gemini-powered\n conversion features.\n5. Optional: You can also use the interactive SQL editor to adjust the converted schema to better meet your needs, even if there are no conversion issues with your object. For a list of editable SQL Server objects, see [Supported object types](/database-migration/docs/sqlserver-to-alloydb/about-conversion-workspaces).\n6. After you fix conversion issues or adjust your schema, click move_down **Convert source** . Database Migration Service now analyzes your changes and generates the updated PostgreSQL schema.\n\n You can inspect the converted schema in the\n **AlloyDB for PostgreSQL draft** tab.\n7. Test the converted schema in your destination database. Do the following:\n 1. Click apps **Apply to destination** \\\u003e **Test**.\n 2. On the **Define destination** page, use the **Destination connection profile**\n drop-down menu to select your destination connection profile.\n 3. Click **Define and continue**.\n 4. On the **Select objects and test application** page, use the checkboxes to select which\n converted PostgreSQL schema you want to apply in your destination database.\n 5. Click **Test application**.\n\n Depending on the test results, you might need to further adjust your\n converted schema.\n8. If the schema snapshot you pulled from the source has more objects that you haven't migrated yet, add these objects to the workspace:\n 1. In the **SQL Server** panel, click add **Add objects** .\n\n The object selection panel opens.\n 2. In the schema tree, use the checkboxes to select which objects you want to add to the conversion and then click **Add objects**.\n9. Repeat steps 3 through 8 until you convert all the objects that you want to migrate.\n10. When you finish converting your schema, click apps **Apply to destination** \\\u003e **Apply** .\n\n Database Migration Service now creates the schema definitions in your destination\n database.\n\nWhat's next\n-----------\n\n- Your conversion workspace is ready for migration. You can now\n [create the migration job](/database-migration/docs/sqlserver-to-alloydb/create-migration-job).\n\n- To get a complete, step-by-step migration walkthrough, see\n [SQL Server to AlloyDB for PostgreSQL migration guide](/database-migration/docs/sqlserver-to-alloydb/guide)."]]