# Incremental extraction

> For most source systems, CData Sync has preconfigured how incremental extractions should be performed. If that's not the case, the settings have to be edited manually to perform incremental extractions. For more on how to do this, refer to the official [CData Sync documentation](https://www.cdata.com/kb/entries/sync-incremental-config.rst).

For most source systems, CData Sync has preconfigured how incremental extractions should be performed. If that's not the case, the settings have to be edited manually to perform incremental extractions. For more on how to do this, refer to the official [CData Sync documentation](https://www.cdata.com/kb/entries/sync-incremental-config.rst).

## Configuring incremental extraction

### Defining the incremental start date

For incremental extraction, it is necessary to define a starting point (or 'incremental start date') from which new or updated data will be extracted for each table.

Follow these steps to define the incremental start date for a table.

1. Go to **Overview** in the **Edit Job** page.
2. Locate the **Incremental Replication** section and select **Configure**.
3. Select a desired **Start Date**.
4. Enter the desired **Replication Interval**, or accept the default of 180 days.
   :::note
   A large replaction interval, may impact performance.
   :::
5. Select **Save**.

### Enabling incremental extraction

To enable incremental extraction for the job in CData Sync, go to the **Advanced** tab, and edit the **Replication** Option to deselect the **Drop Table** option. This enables incremental extraction.

### Check incremental settings

For most source systems, CData Sync has preconfigured how incremental extractions should be performed. If that's not the case, the settings have to be edited manually to perform incremental extractions. For more on how to do this, refer to the official [CData Sync documentation](https://www.cdata.com/kb/entries/sync-incremental-config.rst).

### Adding a timestamp column

For running an incremental extraction using CData Sync, you need to add a timestamp column in the extraction job for every table you want to incrementally load. The timestamp column will keep track of when the data was last extracted, enabling CData Sync to only extract new or updated data for the next iteration.

Follow these steps to configure incremental data extraction using CData Sync.

1. Edit the CData Sync extraction job created in **Create a job**.
2. Go to **Task** and edit the table you want to configure for incremental extraction.
3. Go to **Columns** and select **Edit Mapping**.
4. Select + (Add Column).

   ![Add column option in CData Sync task](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-add-column-option-in-cdata-sync-task-518544-d3a31f3e-e5fa5ddf.webp)
5. Enter the SQL command to convert the timestamp to the correct format. For example:
   1. for MS SQL Server databases enter `FORMAT(GETDATE(), 'yyyy-MM-dd HH:mm:ss')`
   2. for Oracle source databases enter `to_char(CURRENT_TIMESTAMP, 'YYYY-MM-DD HH24:MI:SS')`.
   3. Select **Next**.
6. Enter `EXTRACTED` in the **Column Name** field.
7. Select `TIMESTAMP` as the **Data Type** and select **Add Column**. The following illustration shows an example.

   ![EXTRACTED column of type TIMESTAMP](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-extracted-column-of-type-timestamp-518565-2719f9b8-cf3773f6.webp)
8. Go to **Overview** and edit the **Source Information**.
9. Select the applicable **Incremental Column** from the list.
   :::note
   This should be a column that contains timestamp values for each change or on an integer column that holds the row count for each update.
   :::
10. Select **Save**.

### Define incremental load for the Process Mining process app

1. Open the Process Mining process app in developer mode.
2. Go to **Data transformations**.
3. Go to the **Manage input data** screen,
4. Add the timestamp column to the **Timestamp field** to configure the incremental load for a table. Check out [Managing input data](https://docs.uipath.com/process-mining/automation-cloud/latest/user-guide/managing-input-data#managing-input-data) for more information.

## Running incremental extraction

Check out [Run the job](https://docs.uipath.com/process-mining/automation-cloud/latest/user-guide/run-the-job#run-the-job) for information on how to start the extraction job.

The first time the CData Sync extraction job runs, a full extraction is performed and all source data is extracted. Every next time the CData Sync extraction job runs, only the data that has changed in the source is extracted and the delta is added to the already extracted data.

For more information on incremental data extraction with CData Sync, refer to the [official CData Sync documentation](https://cdn.cdata.com/help/ASM/sync/Advanced-Job-Options.html).
