> For the complete documentation index, see [llms.txt](https://docs.mydbsync.com/cloud-workflow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mydbsync.com/cloud-workflow/create-your-workflow/automation/replication-bot.md).

# Replication Bot

The DBSync Replication Bot replicates data on a schedule from cloud applications such as Salesforce into relational databases such as PostgreSQL, Redshift, or SQL Server. Use it to maintain backups, support reporting, and meet data archival and compliance requirements.

### Create a new automated task <a href="#step1createanewautomatedtask" id="step1createanewautomatedtask"></a>

After creating your project, DBSync redirects you to the **Automation** tab.

{% stepper %}
{% step %}
Click **Create**.
{% endstep %}

{% step %}
Enter a name for the task that reflects the replication flow (for example, `Salesforce to SQL`).
{% endstep %}
{% endstepper %}

### Select the automation agent <a href="#step2selecttheautomationagent" id="step2selecttheautomationagent"></a>

<div data-with-frame="true"><figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FFA73OQd0uc5La2o4hzh3%2Fimage.png?alt=media&amp;token=742ca631-807f-40c0-8745-00ba71ec06b4" alt=""><figcaption></figcaption></figure></div>

{% stepper %}
{% step %}
Click **Select Automation Agent**.
{% endstep %}

{% step %}
From the list of available agents, choose **Replication Bot**.
{% endstep %}

{% step %}
Click **Configure** to open the replication settings.
{% endstep %}
{% endstepper %}

### Configure the source application <a href="#step3configurethesourceapplication" id="step3configurethesourceapplication"></a>

<div data-with-frame="true"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdULB7ilJLy7dk3k8JIrJqJXBZicZMfOhLxqPcx_HU5RZq4Gl8A8CyUOQo3wpTYm71tQ433BpAuq7JYiPOf4fkviPCjn6TPjKhnIx4vj78Dcp1PC-22gaQc_ld1wl1ev0F_2JefCw?key=ZgqvWB7K5_R-bU46Nkxjbw" alt=""><figcaption></figcaption></figure></div>

{% stepper %}
{% step %}
In the **Source App** section, click **Select App**.
{% endstep %}

{% step %}
Click **Test Connection** to verify that DBSync can reach your source. A confirmation dialog indicates whether the connection succeeded. If the test succeeds, click **Save**.
{% endstep %}

{% step %}
Click **Next** to proceed to the target configuration.
{% endstep %}
{% endstepper %}

### Configure the target application <a href="#step4configurethetargetapplication" id="step4configurethetargetapplication"></a>

<div data-with-frame="true"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXflprEUKO4b4tjPYicOdwgNuNQ2oCdoKecueIQhwfNaP4cZ6LeBm6upve1XAGznRBvov9JR-CE8it99bjvWYDIOKZUZyzwi4nZ6xJN0OPCZHj0RxTUsAg25gTq3BWHG5yeFRpcS?key=ZgqvWB7K5_R-bU46Nkxjbw" alt=""><figcaption></figcaption></figure></div>

{% stepper %}
{% step %}
In the **Target App** section, open the dropdown to see databases you've connected in Cloud Workflow.
{% endstep %}

{% step %}
If your target database isn't listed, click **+ Add New** and select the database type you want to configure.\
For more information about connecting a new database, see [Target database setup](https://docs.mydbsync.com/cloud-replication-main/target-setup).
{% endstep %}

{% step %}
Target advanced settings control how DBSync writes data to your destination. The available options include:

* File download
* Prefix settings
* Auto rename
* Database logging

For detailed configuration steps, see [Advanced settings configuration](https://docs.mydbsync.com/cloud-replication-main/target-setup/advance-settings).
{% endstep %}
{% endstepper %}

### Configure objects and fields <a href="#step5configureobjectsandfields" id="step5configureobjectsandfields"></a>

Objects correspond to tables in your source application. Fields correspond to the columns within those tables.

<div data-with-frame="true"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdnJVd01iXJQPwEcqKZcYdxs45IgxkDPVYhvk1Abud-aHYYXUB0o_4YERCQq-pATdTsITg-nPnWaBO-Tfwip1OJronRW33sYa7CLfhrQ_AqOK0N292pNztMp4deBzKOZWe5Y9boqQ?key=ZgqvWB7K5_R-bU46Nkxjbw" alt=""><figcaption></figcaption></figure></div>

{% stepper %}
{% step %}
Click the **Objects** icon <img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FGjGXAjWFYGtuf23vSRrs%2Fimage.png?alt=media&amp;token=8b27e037-44ac-4871-b866-127c06c197b8" alt="" data-size="line"> in the top navigation bar to open the Objects tab.
{% endstep %}

{% step %}
In the left panel, review the list of objects available from your source (for example, Account, Contact, or Opportunity).
{% endstep %}

{% step %}
Check the checkbox next to each object you want to replicate.
{% endstep %}

{% step %}
After selecting an object, its available fields appear in the center panel. Select the fields you want to copy, and move any fields you want to exclude to the **Excluded Fields** section.
{% endstep %}
{% endstepper %}

### Add data masking (optional) <a href="#step6adddatamaskingoptional" id="step6adddatamaskingoptional"></a>

Data masking hides or scrambles sensitive field values such as phone numbers or names during replication.

<div data-with-frame="true"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdSe1THQE9TIvZt0IKkNHjqIGUNjuxIMEufxTt7QW21QAAWrJX2QrpBfP-SFYkz7uBjsLa1PJtWx8oIgrH-kSqlV-psnYY-Xcc0ztSseTiYKn0_zgLVVPXIHp9KWA2H7_KPguL8?key=ZgqvWB7K5_R-bU46Nkxjbw" alt=""><figcaption></figcaption></figure></div>

{% stepper %}
{% step %}
Click **Add Data Mask**.
{% endstep %}

{% step %}
In the popup, click **Data Masking**.
{% endstep %}

{% step %}
Select the object that you want to mask.
{% endstep %}

{% step %}
Select the field, turn masking **on**, and choose a masking type from the dropdown.
{% endstep %}
{% endstepper %}

### Run the replication job <a href="#step7runthereplicationjob" id="step7runthereplicationjob"></a>

{% stepper %}
{% step %}
Click **Run** at the top of the page.

<div data-with-frame="true"><figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FVgJX4FT4tot7pbJveB8F%2Fimage.png?alt=media&amp;token=250cc3b2-5c78-47f5-9e1c-9b86ba742819" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
From the dropdown, select the command you want to execute.

<div data-with-frame="true"><figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FIkItJBVkg547mVsVcVTG%2Fimage.png?alt=media&amp;token=46cae237-3d9d-4734-a2d3-44d6fcf630d5" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Click the **Play** button next to the command.
{% endstep %}
{% endstepper %}

<div data-with-frame="true"><figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FXhAxf9rimmPLD6Dvo2eh%2Fimage.png?alt=media&amp;token=6ce1523a-5f1b-40d0-8fd4-b1852a9c961b" alt=""><figcaption></figcaption></figure></div>

DBSync starts the replication task and displays a confirmation message. Click **OK** to go to the Logs page, where you can monitor data movement in real time.
