> For the complete documentation index, see [llms.txt](https://documentation.astera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.astera.com/data-model/data-model-mapping.md).

# Data Model Mapping

The Data Model Mapping document in Astera allows users to define how metadata is mapped between source and target data models during data transfer operations. This document will go over how we can use Data Model Mapping in Astera.

<figure><img src="/files/o0zvBPygq0Zm7td5UaYI" alt=""><figcaption><p>01-data-model-mapping</p></figcaption></figure>

### Use Case&#x20;

To get started, go to **File > New > Data Model Mapping** in Astera. This opens the Data Model Mapping editor. Here, let's start configuring our mapping by first selecting the Use Case from the dropdown:&#x20;

* **Database Copy:** For standard data transfer between databases.&#x20;
* **Dimensional Modelling:** For mapping data to dimensional models (star/snowflake schemas).&#x20;
* **Migration:** For data migration scenarios. This option enables additional features like Source System Key and Lookup mapping type.&#x20;

Next, configure the data model paths:&#x20;

* **Source Data Model Path:** Browse and select the source data model `(.mdl)` file that contains your source entities.&#x20;
* **Target Data Model Path:** Browse and select the target data model `(.mdl)` file that contains your target entities.&#x20;

**Source System Key (Migration only):** Enter a unique identifier to help identify records from the source system. Once both data model paths are set, the editor loads the entities from both models.&#x20;

### Entity Mappings&#x20;

The left panel displays a tree view of all target entities from your target data model. Click on a target entity to select it. For the selected target entity, configure:&#x20;

* **Target Entity:** Displays the selected target entity name.&#x20;
* **Source Entity:** Select the corresponding source entity from the dropdown.&#x20;

### Field Mappings&#x20;

Once you select a target entity, the Field Mappings Grid displays all fields from that target entity. For each field, configure:&#x20;

1. **Target Field:** The name of the target field.&#x20;
2. **Mapping Type:** Select how this field should be mapped:&#x20;

* **Direct:** Maps a source field directly to the target field.&#x20;
* **Expression:** Use this when you want to map the target field based on any expression/transformation.&#x20;
* **Lookup (Migration only):** Look up a value from another entity based on matching fields.&#x20;

3. **Source Column:** The source field or expression that maps to this target field.&#x20;

### Generate and Refresh Mappings&#x20;

**Generate All Mappings:** Automatically generates mappings for all entities based on matching field names.&#x20;

**Refresh All Mappings:** Refreshes mappings when source or target models have changed.&#x20;

**Generate Entity Mappings:** Generates mappings only for the currently selected entity.&#x20;

**Refresh Entity Mappings:** Refreshes mappings only for the currently selected entity.&#x20;

### Using the Mapping File&#x20;

Once configured, save the mapping document. The file is saved with a `.dmap` extension. To use the mapping file, reference it in the Database Copy workflow task by providing the file path in the Mapping File Path property.&#x20;

&#x20;

We have now successfully configured our Data Model Mapping document in Astera.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.astera.com/data-model/data-model-mapping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
