.. _create-a-custom-data-sync:

Create a Custom Data Sync
-------------------------

.. _21.1|VOSS-794|EKB-8517:

Create a custom data sync to use a targeted Model Type List.

**Perform these steps**:

1. Log in as provider admin or higher.
#. Choose **Administration Tools > Data Sync**.
#. Click **Add**.
#. Enter the name of the Data Sync in the **Name** field.

   It is recommend to use a naming convention that makes it easy to identify the
   data syncs in the list view, such as C1Pull-CUCM01-DS where C1 is the
   customer name, Pull is the data sync type, CUCM01 is the name of the Cisco
   Unified Communications Manager, and DS stands for Data Sync. You could also
   include the type of data included in the sync, such as
   C1Pull-CUCM01-MediaResources-DS.
   
#. From the **Device Type** drop-down, choose the Device Type you are syncing from.
#. From the **Sync Type** drop-down, choose **Pull from Device**.
#. From the **Dependency Resolution** drop-down, choose **Default**.
#. Select the **Execute Asynchronously** and **Refresh Existing (Changed) Data**
   check boxes.

   Execute Asynchronously means that the sync request will return a reply before
   its complete when executed from the API. Refresh Existing (Changed) Data means
   that all instances of the device models specified in the Model Type List will
   be updated.
   
#. Select the **Force Refresh of Data** check box if a data update is required
   regardless of whether data has changed on the device. This option would for
   example be used if it is required that update workflows be run upon a data sync.
#. From the **Model Type List** drop-down, choose the targeted Model Type List you
   defined earlier.
#. Leave **Synchronization Order** and **Model Instance Filter** blank.
#. Click + next to **Device Filters** to add an entry to the list.

   a. From the **Attribute Name** drop-down, choose **host**.
   b. From the **Condition** drop-down, choose **Equals**.
   c. From the **Value** drop-down, choose the hostname/IP address of the device.

   .. note::

      Workflows can be added to, and executed by a custom data sync to perform specific
      data sync operations.

#. In the **Workflows** section, include workflows in the custom data sync if you
   want to perform specific data sync operations, otherwise leave the **Workflows**
   section empty. For example, if you want to move remote destinations from the
   Customer hierarchy level to the Site level, choose the **RD_Overbuild_PWF_wrapper**
   workflow from the **Workflow** drop-down.

#. From the **Transaction Log Level** drop-down, choose the log level for the data sync.
   For a description of the list of log levels, see :ref:`transaction-log-levels`. The default
   log level is *Warning*.
   
   You can for example reduce the log level for PULL device syncs in order to reduce the size
   of transaction logs. This is useful where large numbers of transactions are archived regularly.

#. Click **Save**.


.. rubric:: Next Steps

To run the custom data sync, click the data sync from the **Data Sync** list and
click **Execute**.