# One-To-Many Migration

The "One-to-Many Migration" option is used for migrating data from a single Source data record to multiple Target data records (SecondaryEntities).  The records can also be linked to create parent/child relationships.

&#x20;

To perform "One-to-Many Migration"  using the appRules Data Migration Engine, drag-and-drop the MigrateData workflow activity from the toolbox on to the designer and configure as follows:

1. Enter a display name and description for the workflow activity or accept the defaults.
2. Select "One-to-Many Migration" as the Data Migration Type.
3. Select the Default Source.  If the Source data source does not exist, you can use the New Data Source button to add it.
4. Select the Default Target.  If the Target data source does not exist, you can use the New Data Source button to add it.

<figure><img src="/files/CAKYnnoJAqZbjIzJuwRT" alt=""><figcaption></figcaption></figure>

Click the OK button to accept the entries and continue.

The "Initialize One-to-Many Migration" modal will be displayed:

<figure><img src="/files/AO2vRPW8txXzgTck8CxE" alt=""><figcaption></figcaption></figure>

Initialize the "One-to-Many Migration" option by configuring the fields as follows:

1. Select the Source entity/table to be migrated.
2. Select the primary target entity.
3. Select the secondary target entities.

Click the OK button to accept the entries and display the Target Entities Collection.

<figure><img src="/files/QWbwO0hZXNMO6RfqFHCF" alt=""><figcaption></figcaption></figure>

## Target Entities Collection

{% hint style="info" %}
Note that the system automatically generates entries for the secondary entities in the Target Entities Collection.
{% endhint %}

Refer to the [Target Entities Collection](/apprules-r-documentation/platform-products/apprules-data-migration-engine/the-migrate-data-activity/target-entities-collection.md) section for notes on configuring the target entities including the secondary entities.

[Run your data migration project](/apprules-r-documentation/platform/platform-features/creating-and-running-projects/running-projects.md) after configuring, reviewing, and saving the [Target Entities Collection](/apprules-r-documentation/platform-products/apprules-data-migration-engine/the-migrate-data-activity/target-entities-collection.md).

{% hint style="info" %}
Review the [One-to-Many Migration](/apprules-r-documentation/samples/sample-projects/data-migration-replication-and-synchronization/one-to-many-data-migration.md) sample project to learn more about how to create  "One-to-Many Migration" projects in appRules.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform-products/apprules-data-migration-engine/the-migrate-data-activity/one-to-many-migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
