

# Mapping data types in the AWS Schema Conversion Tool
<a name="CHAP_Mapping"></a>

 You can add multiple source and target databases in a single AWS SCT project. Doing this simplifies the management of projects, when you migrate multiple databases to different target platforms. 

 After you create a new project and add source and target databases, create mapping rules. AWS SCT requires at least one mapping rule to create a migration assessment report and convert database schemas.

 A *mapping rule* describes a source-target pair that includes a source database schema or source database and a target database platform. You can create multiple mapping rules in a single AWS SCT project. Use mapping rules to convert every source database schema to the right target database platform.

To change the name of your schema in the converted code, set up a migration rule. For example, with migrations rules, you can rename your schema, add a prefix to object names, change column collation, or change data types. To apply these changes to your converted code, make sure that you create migration rules before you convert your source schema. For more information, see [Applying migration rules](CHAP_Converting.MigrationRules.md).

 You can create mapping rules only for supported database conversion pairs. For the list of supported conversion pairs, see [Connecting to source databases with the AWS Schema Conversion Tool](CHAP_Source.md). 

 If you open a project saved in AWS SCT version 1.0.655 or before, AWS SCT automatically creates mapping rules for all source database schemas to the target database platform. To add other target database platforms, delete existing mapping rules and then create new mapping rules. 

**Topics**
+ [Mapping new data types in the AWS Schema Conversion Tool](CHAP_Mapping.New.md)
+ [Editing data type mappings in the AWS Schema Conversion Tool](CHAP_Mapping.Edit.md)
+ [Mapping to virtual targets in the AWS Schema Conversion Tool](CHAP_Mapping.VirtualTargets.md)
+ [Limitations of data type mapping in the AWS Schema Conversion Tool](CHAP_Mapping.Limitations.md)

# Mapping new data types in the AWS Schema Conversion Tool
<a name="CHAP_Mapping.New"></a>

You can create multiple mapping rules in a single project. AWS SCT saves mapping rules as part of your project. With your project open, use the following procedure to add a new mapping rule.

**To create mapping rules**

1.  On the **View** menu, choose **Mapping view**. 

1.  In the left panel, choose a schema or a database to add to the mapping rule. 

1.  In the right panel, choose a target database platform for the selected source schema or database. 

   You can choose a virtual database platform as a target. For more information, see [Mapping to virtual targets in the AWS Schema Conversion Tool](CHAP_Mapping.VirtualTargets.md). 

1. Choose **Create mapping**.

    AWS SCT adds this new mapping rule to the **Server mappings** list. 

 Add mapping rules for all conversion pairs. To create an assessment report or convert database schemas, choose **Main view** on the **View** menu. 

AWS SCT highlights in bold all schema objects that are part of a mapping rule. 

# Editing data type mappings in the AWS Schema Conversion Tool
<a name="CHAP_Mapping.Edit"></a>

You can filter or delete existing mapping rules, and add a new mapping rule in your AWS Schema Conversion Tool (AWS SCT) project.

When you create a mapping rule for the whole source database, AWS SCT creates one mapping rule for each source database schema. For projects that involve dozens of schemas or even databases, it may be hard to understand, which target is used for a certain schema. To quickly find a mapping rule for your schema, use one or several of the following filter options in AWS SCT.

**To filter mapping rules**

1. On the **View** menu, choose **Mapping view**.

1. For **Source servers**, choose the source database.

   The filter default is **All**, which means that AWS SCT displays mapping rules for all source databases.

1. For **Source schema**, enter the source schema name. Use the percent (`%`) as a wildcard to replace any number of any symbols in the schema name.

   The filter default is the **%** wildcard, which means that AWS SCT displays mapping rules for all source database schema names.

1. For **Has migration rules**, choose **Yes** to display mapping rules for which the data migration rules are created. Choose **No** to display mapping rules which don't have data migration rules. For more information, see [Creating data migration rules in AWS SCT](agents.md#agents.Filtering).

   The filter default is **All**, which means that AWS SCT displays all mapping rules.

1. For **Target servers**, choose the target database.

   The filter default is **All**, which means that AWS SCT displays mapping rules for all target databases.

With your project open, use the following procedure to delete a mapping rule. For more information on adding mapping rules, see [Mapping new data types in the AWS Schema Conversion Tool](CHAP_Mapping.New.md).

**To delete mapping rules**

1.  On the **View** menu, choose **Mapping view**. 

1. For **Server mappings**, choose the mapping rules to delete. 

1. Choose **Delete selected mappings**.

    AWS SCT deletes the selected mapping rules. 

# Mapping to virtual targets in the AWS Schema Conversion Tool
<a name="CHAP_Mapping.VirtualTargets"></a>

You can see how AWS SCT converts your source database schema to any supported target database platform. To do so, you don't need to connect to an existing target database. Instead, you can choose a virtual target database platform in the right panel when you create a mapping rule. For more information, see [Mapping new data types in the AWS Schema Conversion Tool](CHAP_Mapping.New.md). Make sure that you expand the **Servers**, **NoSQL clusters**, and **ETL** nodes in the right panel to see the list of virtual target database platforms. 

 AWS SCT supports the following virtual target database platforms: 
+ Amazon Aurora MySQL-Compatible Edition
+ Amazon Aurora PostgreSQL-Compatible Edition
+ Amazon DynamoDB
+ Amazon Redshift
+ Amazon Redshift and AWS Glue
+ AWS Glue
+ AWS Glue Studio
+ Babelfish for Aurora PostgreSQL
+ MariaDB
+ Microsoft SQL Server
+ MySQL
+ Oracle
+ PostgreSQL

 If you use Babelfish for Aurora PostgreSQL as a target database platform, you can only create a database migration assessment report. For more information, see [Using the assessment report in the AWS Schema Conversion Tool](CHAP_AssessmentReport.md). 

 If you use a virtual target database platform, you can save converted code to a file. For more information, see [Saving your converted schema to a file](CHAP_Converting.SaveAndApply.md#CHAP_Converting.Saving). 

# Limitations of data type mapping in the AWS Schema Conversion Tool
<a name="CHAP_Mapping.Limitations"></a>

The following limitations apply when converting schemas using multiple servers in a single AWS SCT project:
+ You can add the same server to a project only once.
+ You can't map server schemas to a specific target schema, only to a target server. AWS SCT creates the target schema during conversion.
+ You can't map lower-level source objects to the target server.
+ You can map one source schema to only one target server in a project.
+ Make sure to map a source to a target server to create an assessment report, convert schemas, or extract data.