Page History
You can configure your DataSync Agent to share data from ServiceNow or Salesforce to a PostgreSQL database by changing some additional configurations in your agent.xml file.
Panel | ||||
---|---|---|---|---|
| ||||
|
Prerequisites
First, you will need to Install the DataSync Agent.
You will also need to create a ServiceNow dynamic share/bulk share.
Make sure to stop running your DataSync Agent before making any Agent configuration changes.
Finally, you will need to create a database in PostgreSQL that will store data replicated via the DataSync Agent.
Procedure
To set up your DataSync Agent to share application data to a PostgreSQL database, follow these steps:
UI Steps | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
UI Expand | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
By default, the DataSync Agent will set datetime fields with the timestamp data type which will not have a time zone. The PostgreSQL JDBC driver as used by the Agent does not support a time zone parameter so any datetime values are passed in based on the time zone of the server where the Agent is running. If you are running the Agent on a server with a non-UTC time zone and want to ensure records are saved properly so you can query the PostgreSQL database in different time zones, do the following: Divbox | | |||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
UI Steps | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
UI Step | ||||||||||||||||||||||||||||||||||||||||||||
Old Value | New Value | |||||||||||||||||||||||||||||||||||||||||||
TIMESTAMP | TIMESTAMP WITH TIME ZONE |
Code Block |
---|
<database>
<database_type>postgresql</database_type>
<datatypes>
.
<mapping sn_type="93" db_type="93">TIMESTAMP WITH TIME ZONE</mapping>
.
</datatypes>
</database> |
UI Step | ||
---|---|---|
Edit the wrapper.conf located in the Agent's conf folder i.e. <Perspectium_Replicator_Agent_Installed_Directory>/conf to add a new Java Additional Parameter. Look for the line # Java Additional Parameters section and the highest number parameter listed and then add the following line: wrapper.java.additional.<Highest Number + 1>=-Duser.timezone=GMT Replacing <Highest Number + 1> with the current highest number parameter and adding one. For example, if the current highest number 3, this value would be 4 i.e. wrapper.java.additional.4=-Duser.timezone=GMT Snippet of wrapper.conf:
This will ensure the PostgreSQL JDBC driver is saving data into the database in UTC time. You can also modify the server the Agent is running on and set its timezone to UTC if you prefer not to make this change to the wrapper.conf. |
Since ServiceNow's data is sent out is in UTC time, doing the above ensures data is saved properly in UTC time in the database. You can now query in different time zones by using the SET TIME ZONE '<TIME ONE>'; SQL command where <TIME ZONE> is the desired time zone to query in. For example:
SET TIME ZONE 'US/Eastern';
Will allow you to query for records in the US Eastern Timezone. See SET for more information.
UI Step |
---|
After configuring your agent.xml file to support replication to your PostgreSQL database, start running your DataSync Agent again. |
Additional Configurations
For optional configurations for how the DataSync Agent interacts with your PostgreSQL database. Contact Perspectium Support if you have any questions.
|