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

Create a custom data sync
-------------------------

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


.. tip:: 

   :ref:`use-action-search-to-navigate-automate`


Create a custom data sync to use a targeted model type list.


1. Log in as provider admin or higher.
#. Go to the **Data Sync** page.
#. Click the Plus icon (+) to add a new record.
#. Fill out a name for 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 UCM 
   * DS is the acronym 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're 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**
   checkboxes.

   *Execute Asynchronously* means that the sync request will return a reply before
   it's 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** checkbox 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 the Plus icon (+) adjacent 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.

   If the **Synchronous** checkbox is enabled, the workflows will execute
   in sync with data sync transaction, so that the parent pre- and post workflow
   steps are honoured. If disabled, the workflows will not be child transactions
   of the data sync execute transaction.

#. 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**.
