Moving data from one instance to another while maintaining sys_ids but ensuring sys_updated_on

SB87
Tera Expert

We have several ServiceNow instances including PreProd and Prod.

 

Often, data, like cmn_location or core_company records are moved from PreProd to Prod using methods like XML Exports. This approach is used to ensure the sys_ids are maintained between instances for reconciliation activities or backgrounds scripts that specify a specific sys_id.

 

The trouble we are finding is that the sys_updated_on does not get updated in the receiving environment to the date/time the record is moved across. This causes issues with our DWH where our imports are monitoring for changes applied to records which uses the MAX(sys_updated_on) of the last import run as a starting point.

 

What options are there? We need to:

  1. Maintain sys_ids between environments
  2. Need to ensure any record moved from one instance to another returns a sys_updated_on value of the date/time the record was moved to the receiving environment in order for our DWH to identify this.

Many thanks,
SB

 

2 REPLIES 2

Bert_c1
Kilo Patron

Edit the XML file, before import, and set the desired value of the 'sys_updated_on' field.

jcmings
Mega Sage

You'll either need to edit the XML to match or force an update to all of the files once they are loaded in.

 

You could also achieve this with a fix script (looping through each record based on sys_id) after import. Here is a post that details how to do this (note that you need to include the below line; also note the KB0859763 mentioned).

gr.autoSysFields(false);