Export the Data in Production and Import into Dev automatically

Srinivas Chinn1
Tera Contributor

Hi all,

I'm trying the import the data from the production by using data source XML path.
the data is inserting into the Dev instance but with different sys_id. Means same record in the production is having different sys_id and in Dev is having different sys_id. 
i want to maintain the same sys_id's across the instances. i have tried below method but it inserting with new sys_id's in instances.

Create an XML data source to another instance.

Any help or suggestions is much helpful. 

13 REPLIES 13

Hi @Srinivas Chinn1 

 

This is expected behaviour if you use the data source, and i.e. reason I said, you direct import - export. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Srinivas Chinn1,

 

Have you set the 'Coalesce' column/field to true for the 'sys_id' field on the Transform Map?

Think of 'Coalesce' as a Primary Key in Database terms. If you set this, it means the import process will check for this sys_id and update the record if it already exists, or insert and create a new record if it does not.

 

Did you see my earlier post - if you import via XML data sources, import sets, transform maps etc are not required.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

Hi Robbie,

Yes im setting the sys_id as colescale. But the data which is coming Production is not available in Dev since it is newly created data on Production itself. From the data source im able to export the data and Import into Dev instance. But the issue is same record is having different sys_id means in Dev the sys_id of the record is different and in Production sys_id of the record is different. how can sync the same sys_id for the records on both the instances

Hi @Srinivas Chinn1,

 

As I mentioned in a previous post but I appreciate it may have been lost in the thread,

if you're exporting records from Production via XML, you can simply import these records via the same process and via the same XML file - Data sources and transform maps etc are not required.

 

Note - ServiceNow will only create new sys_id's for these records if the sys_id is already used. Please note however, if the sys_id is already used and it's associated to the same record - eg a CI record - then the said CI record will be updated to match the import thus syncing up with the imported file (And in your case Production)

 

My recommendation is to simply both import the XML file. To do this, simply navigate to the table list view and filter the records accordingly - example (Active records only) and at one of the column headers right-click, and select 'Export > XML' or 'Import XML'. - See below screen shot.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

 

Screenshot 2024-06-20 at 11.37.04.png