The procedures described in this documentation are best practices for setting up Perspectium DataSync for the typical use cases when sharing data from your ServiceNow instance to target databases and files. 

For other ways to get started with DataSync, click here or contact Perspectium Support


Prerequisites


(warning) First, request for the downloadable link for Perspectium for ServiceNow application.

(warning) Make sure that the device you are installing the DataSync Agent on meets these basic requirements.

(warning) You will also need to request the Agent Installer from Perspectium Support.

(warning) You will need the following information from Perspectium Support:

  • Perspectium Integration Mesh (MBS) server URL
  • Integration Mesh (MBS) username
  • Integration Mesh (MBS) password




ServiceNow Install

To install the Perspectium Application for ServiceNow you need to have admin access to the ServiceNow instance and should have received the update set from Perspectium Support which will be imported, validated and committed during installation. You can follow these steps to install in ServiceNow:

  1. Go to System Update Sets >> Retrieved Update Sets and import the update set xml file.
  2. Open the update set and click Preview. Errors or warnings are not expected but if there are any those need to be reviewed on a one to one basis.
  3. Click the Commit Update Set button to commit the update set.
  4. In the ServiceNow Navigator go to the new Perspectium module and open the Finish Install page.
  5. Click on the “Confirm” button and wait for a successful confirmation message.

Set up MBS Credentials and Encryption Keys

Once installation is finished you need set up some initial configurations:

  1. Go to Perspectium >> Properties >> General Settings.
  2. Enter the Perspectium Message Bus credentials provided to you by Perspectium
    1. Perspectium Integration Mesh username.
    2. Perspectium Integration Mesh password.
    3. Perspectium Integration Mesh server URL - this is usually in the form https://customername.perspectium.net
    4. The rest of the settings you can leave with their default values and scroll down to the bottom of the page to click Save.
    5. Go back to Perspectium >> Properties and navigate to the DataSync settings.
    6. Populate the Encryption key entry with an encryption string of your choice. We advise you to use at least 32 characters encryption key to be able to leverage AES256 payload encryption. This encryption key does not need to be shared with Perspectium. It is used to encrypt the data shared in transit when flowing through the Perspectium message bus so it can be properly secured.
    7. In the Decryption Key input specify a decryption string which can be used by the ServiceNow instance to descrypt any inbound messages. In many cases you will use the same key as your encryption key so data can be encrypted and decrypted the same in both directions.
    8. Scroll down to the bottom of the page to save it.

Create Queues

In order to share data to the Perspectium Integration Mesh (Message Broker Service aka MBS) you need to configure at least one shared queue since MBS is queue based. This queue will be used by the ServiceNow instance to share records while the DataSync Agent will subscribe to the same queue in order to be able to receive records, decrypt the shared content and issue the necessary SQL queries to populate those records into the target database.

  1. Go to Perspectium >> Shared Queues.
  2. Click the New button to create a new record.
  3. Set the status to Active.
  4. In the Queue type select DataSync from the dropdown.
  5. Enter a name of the queue without spaces e.g. acmedefault.
  6. You should notice that the queue user, password and encryption key should auto populate based on the details entered in the Perspectium Properties.
  7. Save the queue and notice in the record header the full queue name with the automatically added prefix. It should look like psp.out.replicator.acmedefault. You will need this queue name later when configuring the DataSync Agent to subscribe to it.
  8. Click on the Get Queue Status related link to query the Perspectium MBS for the validity of the queue. If the credentials are valid you should get a message indicating that either the queue exist and the credentials are valid or a message saying that the queue does not exist yet due to no sata being shared to it but still have valid credentials and will be auto created once you start sharing records.
  9. Go to Perspectium >> Subscribed Queues. You should notice one queue already existing there with a name of psp.out.servicenow.instancename where instancename is the name of your ServiceNow instance. Subscribed queues are used by ServiceNow to be able to receive messages form MBS. For example, messages are sent to the instance when the DatraSync agent needs to send some response back to ServiceNow. Usually you are fine with just the default subscribed queue and don’t need to add any more subscribed queues.




DataSync Agent Install

Install Agent to Share to a Database

The Perspectium DataSync Agent can be installed both on Windows or Linux machines. Before installing consulting with this article for minimum requirements.

The virtual machine where you will be installing the agent needs to have connectivity to:

  1. The Perspectium message bus endpoint e.g. customername.perspectium.net via http port 443.
  2. The target database via the port this database will listen to.
  3. The source ServiceNow instance. This connection is only needed for the Agent to be able to fetch specific ServiceNow table schemas when it needs to create or alter table schema in the target database to reflect its ServiceNow structure.

Make sure the necessary network connectivity exists and the needed firewall rules are set properly before you start the installation.

Once you start the installation package perform the following steps:

  1. Accept the Perspectium Licence Agreement.
  2. Specify the directory where the Agent should be installed.
  3. Specify the installed Java version which you want to use.
  4. In the DataSync type specify the type of database for which you are installing the Agent.
  5. Next specify the Perspectium Integration Mesh details as provided to you by Perspectium
    1. Server - this is your Perspectium Integration Mesh endpoint in the form of customername.perspectium.net.
    2. User - your Integration Mesh user.
    3. Password - your Message Bus password.
    4. Queue name - this is the shared queue you have created in ServiceNow, usually psp.out.replicator.mysharedqueuename.
    5. Encryption/Decryption key - this should match the encryption key specified in ServiceNow Under Perspectium >> Properties >> DataSync Properties >> Encryption Key.
    6. Max Reads - maximum number of reads per connection to the Message Bus - you can leave the default number here
    7. Polling interval - the interval in seconds between two agent polls to fetch Message Bus records - you can leave the default number here.
  6. Next you need to specify the information about the ServiceNow instance
    1. Instance - the name of the instance in the form of customer.service-now.com
    2. User - this must be a ServiceNow system account with at least the “perspectium” role. This user is needed by the Agent to be able to fetch dynamically the table schema for any table being shared to the database so that the Agent can create a similar table schema in the target database.
    3. Password - this user's password.
  7. Next step is to enter the database details
    1. Server - this is the address of the database.
    2. Port - which can be used by the Agent to connect to the database
    3. User - the username of the system account which is used to connect to the database.
    4. Password - this user's passwod
    5. Database - the hostname of the database which is created or should be created by the Agent to store the replicated ServiceNow data. Note that if the Agent needs to create this database it needs the specific CREATE DATABASE or similar permission against the DB server.
  8. On the next step review the specified settings and continue until the installation completes.

Agent Plugins Install

IODatetime Plugin

The IO Datetime plugin allows the DataSync agent to add additional columns to the synchronized tables to specify the timestamps of when those records were first inserted, last updated or deleted into the database. As opposed to the usual ServiceNow sys_updated, sys_created_on which keep the date and time when those transactions happened in ServiceNow the IO Datetime plugin columns keep the timestamps of the database transactions triggered by the agent. This plugin can be activated by adding the following lines to the agent.xml within the <task> directive:

<!-- Create the columns -->
<dynamic_columns>    
    <dynamic_column column_type="93" column_size="32" deletes_only="true">psp_per_delete_dt</dynamic_column>
    <dynamic_column column_type="93" column_size="32" updates_only="true">psp_per_update_dt</dynamic_column>
    <dynamic_column column_type="93" column_size="32" inserts_only="true">psp_per_insert_dt</dynamic_column>
</dynamic_columns>
  
<!-- Update the columns -->
<plugins>
    <plugin insert_column="psp_per_insert_dt" update_column="psp_per_update_dt" delete_column="psp_per_delete_dt">com.perspectium.replicator.sql.plugin.SQLSubscriberIODateTimePlugin</plugin>
</plugins>