This page shows you how to create a conversion workspace and use it to perform automated code and schema conversion from Oracle to PostgreSQL. Before you create the workspace, make sure that you create a connection profile for your source database.
Workspaces with the built-in editor
To create an interactive conversion workspace and perform the schema conversion, do the following:
- In the Google Cloud console, go to Conversion workspaces.
- Click Set up workspace.
- On the Create a conversion workspace page, do the following:
- Enter the name, identifier, and region for your conversion workspace.
- From the Source database engine drop-down menu, select Oracle.
- From the Destination database engine select Cloud SQL for PostgreSQL.
- Click Create workspace and continue.
- On the Define source and pull schema snapshot page, do the following:
- From the Source connection profile drop-down menu, select the connection profile for your source database.
- Click Pull schema snapshot and continue.
Database Migration Service is now connecting to the source database and retrieving your schema. This process can take several minutes.
- On the Select and convert objects page, use the checkboxes to select which objects
you want to convert to PostgreSQL syntax.
You don't have to convert all your objects in one go. Instead, you can select just a few objects now and add more objects to the conversion later.
- Click Convert and continue.
The conversion workspace opens.
Legacy conversion workspaces
Legacy conversion workspaces are an older, more limited type of conversion workspaces. We don't recommend using the legacy type of conversion workspaces for your migrations. If you need to use a legacy conversion workspace, expand the Create a legacy conversion workspace and convert schema section for more information.
Create a legacy conversion workspace and convert schema
Legacy conversion workspaces use Ora2Pg configuration files. Before you create a legacy conversion workspace, make sure you first create your Ora2Pg configuration outside Database Migration Service. For more information, see Work with legacy conversion workspaces.
- In the Google Cloud console, go to Conversion workspaces.
- Click Set up workspace.
- On the Create a conversion workspace page, do the following:
- Enter the name, identifier, and region for your conversion workspace.
- From the Source database engine drop-down menu, select Oracle.
- From the Destination database engine select Cloud SQL for PostgreSQL.
- Expand the Customize workspace configurations section, and check the Enable legacy conversion workspace box.
- Click Create workspace and continue.
- On the Connect to source and convert objects page, do the following:
- From the Source connection profile drop-down menu, select the connection profile for your source database.
-
In the Configuration file box, click Browse and use the system file picker to select your conversion mapping file.
You can upload multiple conversion mapping files by clicking Add file.
-
In the Convert the configuration section, click Pull schema and convert.
Database Migration Service is now connecting to the source database, retrieving your schema and converting it to the destination SQL schema according to the rules defined in your conversion mapping file. This process can take several minutes.
- Click Save and close.
The conversion workspace details page opens.
You can now apply the converted schema to your destination database. If your source database includes tables that don't have primary keys, you also need to manually create primary key constraints in the converted tables in the destination database after you apply the converted schema. For more information, see Work with legacy conversion workspaces.
What's next
You can now work with your conversion workspace to fix conversion issues, modify your objects with the interactive editor, and apply converted schema to your destination database. See Convert Oracle code and schema to PostgreSQL syntax.