Moving data from one instance to another while maintaining sys_ids but ensuring sys_updated_on
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 07:31 AM - edited 04-15-2025 07:33 AM
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:
- Maintain sys_ids between environments
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 07:35 AM
Edit the XML file, before import, and set the desired value of the 'sys_updated_on' field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 09:58 AM
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);