Table data export
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Team,
we have one table (hr_mapping) there are 80k + records in prod instance we want export & import this records into our lower instance can anyone suggest the best way to achieve this any schedule job script..? kindly help me in the script or any other best solution might me helpful to us
Regards
Shabbir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Shabbir1 ,
It is not advisable to export 80k records by using scheduled job, because script will loop over into 80k records to export it.
So you may consider to export as xml or csv and import into lower instance.
1) XML Export (Quick & Simple)
Use Export → XML from the list view
Import the XML file into the lower instance
Suitable if there are no complex references or dependencies
2) Export Set + Import Set (Best Practice)
Export data from Prod as CSV/XML
Load it into the lower instance using Import Sets
Transform Map helps control field mapping and avoid data issues.
If xml or csv export takes long time means, in the hr mapping table, consider a filter like(year wise or month wise or any other fields which splits you 80k records to some point means).
If this is useful...Please mark it as helpful.. Please Accept my solution...
Best Regards,
SIVASANKARI S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Import–export with transform will not give a proper result, as it creates new sys IDs for the records and in that case prod data is not same lower or vice versa
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/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @DR Atul G-LNG,
If there is a concern about new sys_id values being created, we can export the existing data along with the sys_id by using the below parameter:
https://<your_instance>.service-now.com/hr_mapping_list.do?CSV&sysparm_default_export_fields=all
During import, we can then use sys_id as the coalesce field to ensure records are updated correctly instead of creating new ones. I believe this approach should work as expected.
If you find this helpful, please mark it as helpful.
Best regards,
Sivasankari S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Shabbir1 ,
So one easy solution for this would be to export the record and xml and import them in your lower instance. This is indeed easy but is not advisable as it poses the threat of data breach.
Instead, you can create a REST Message to connect with the lower instance and have your scheduled script call this REST Message. The main thing to keep in mind is that send your data in batches to keep the load as minimal as possible
IF YOU FIND MY REPSONSE HELPED YOU, PLEASE MARK IT AS HELPUL.
Regards,
Manish Singh
