> For the complete documentation index, see [llms.txt](https://pathta.gitbook.io/pathta-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pathta.gitbook.io/pathta-docs/data-synchronization/create-a-data-synchronization-path.md).

# Create a data synchronization path

{% hint style="info" %}
A data synchronization path is a transfer of data from a source to a target data source. The target data source should allow writing data. See the[ data sources section](/pathta-docs/create-a-data-source/the-data-sources.md)
{% endhint %}

{% embed url="<https://www.tella.tv/video/create-a-data-synchronization-path-evct>" %}
Create a data synchronization path
{% endembed %}

{% stepper %}
{% step %}

### <mark style="color:red;">STEP 1</mark>

Create a data synchronization path
{% endstep %}

{% step %}

### <mark style="color:red;">STEP 2</mark>

Select or add a data source
{% endstep %}

{% step %}

### <mark style="color:red;">STEP 3</mark>

Select or add a destination for your data
{% endstep %}

{% step %}

### <mark style="color:red;">STEP 4</mark>

Choose the correspondance and transformation between source and target data
{% endstep %}

{% step %}

### <mark style="color:red;">STEP 5</mark>

Fill the setup, publish and run your path
{% endstep %}
{% endstepper %}

## 1. Create a data synchronization path

<figure><img src="https://1039087027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKMgBZ3wq0SUPGSqOmR9C%2Fuploads%2FjJzcFJRD6gpDTkvOF8iM%2Fimage.png?alt=media&amp;token=59ba72c9-2e6f-4359-ae0e-969a9f639800" alt=""><figcaption><p>Create a data synchronization path</p></figcaption></figure>

## 2. Select or add a data source

You have to select or create a data source and then select the database and the table

<figure><img src="https://1039087027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKMgBZ3wq0SUPGSqOmR9C%2Fuploads%2FAcBJZQzY2RzMyZezrGD4%2Fimage.png?alt=media&amp;token=285ca8a6-455e-4c86-b1bd-f1523ef908f2" alt=""><figcaption><p>Select or add a data source</p></figcaption></figure>

## 3. Select or add a destination for your data

You have to select or create a target data source and then select the database and the table

{% hint style="info" %}
For the target data source you can only create or use a data source which is not readonly : see the section [data sources](/pathta-docs/create-a-data-source/the-data-sources.md) for more information
{% endhint %}

<figure><img src="https://1039087027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKMgBZ3wq0SUPGSqOmR9C%2Fuploads%2Fh5WHfmcPDs0az1FWwpij%2Fimage.png?alt=media&amp;token=a13c6b24-16bf-41c0-9190-545dd182ca93" alt=""><figcaption><p>Select or add a destination for your data</p></figcaption></figure>

## 4. Choose the correspondance and transformation between source and target data

You can make a mapping between source and destination fields.\
Only fields in destination which are mapped with a source field would be modified.\
You can apply a transformation between a source and a destination field.

{% hint style="info" %}
The KEY(s) field(s) let Pathta to know where the data already exist or not in target source. If data exist Patha do an update otherwise pathat insert new data
{% endhint %}

{% hint style="warning" %}
You must have at least one target field mapped with a source field.\
You must select one or more key field
{% endhint %}

<figure><img src="https://1039087027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKMgBZ3wq0SUPGSqOmR9C%2Fuploads%2FPVKgk0RDX8ulpWTC7Zb4%2Fimage.png?alt=media&amp;token=d2d9e7f8-bb64-4a24-9c36-8536e15ffdc2" alt=""><figcaption><p>Fill the mapping between source fields and target fields</p></figcaption></figure>

* You can check (if the target data source allow deletion, see [data sources](/pathta-docs/create-a-data-source/the-data-sources.md) for more information) the checkbox "***Data deletion authorize***". If checked and if a data exist in target data source but not in source the the data will be deleted from the target data source
* You can also check the checkbox "***Scheduling enabled***" in order to schedule the execution of the path.\
  Automatic execution can be setted Every day at a precise hour or every given minutes (for example every 15 minutes).

{% hint style="warning" %}
A path need to be published to be run automatically (or manually)
{% endhint %}

<figure><img src="https://1039087027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKMgBZ3wq0SUPGSqOmR9C%2Fuploads%2FuzRtvNonhLNLEkp0EwHl%2Fimage.png?alt=media&amp;token=5bb1b602-4859-425f-9acf-5d170536c1bd" alt=""><figcaption><p>Synchronization setup</p></figcaption></figure>

You can execute manually you path with the Synchronize button. The button is available only if the path has been **published**. It run the **last published** version of the path.

<figure><img src="https://1039087027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKMgBZ3wq0SUPGSqOmR9C%2Fuploads%2FAiUDmM7a3odKhPz3ydrm%2Fimage.png?alt=media&amp;token=7b8c4d75-f1bf-499f-902b-b92e982b44f5" alt=""><figcaption><p>Execute your path manually</p></figcaption></figure>
