How to restore the knowledge articles from one instance to another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi Everyone
Need your help on one of my requirement to get the knowledge articles from one instance and create or update it on another instance through schedule job. We have to get the data ( publish , retired ) from one instance and create or update it on another instance with out any information or mail to trigger the user.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @msc ,
you can archive with schedule job
(function execute() {
var r = new sn_ws.RESTMessageV2('KB Sync from Source', 'get');
var response = r.execute();
var data = JSON.parse(response.getBody()).result;
for (var i = 0; i < data.length; i++) {
var src=data[i];
var kb = new GlideRecord('kb_knowledge');
kb.addQuery('u_source_sys_id', src.sys_id); // custom field
kb.query();
if (kb.next()) {
// UPDATE
kb.setWorkflow(false); // ✅ No emails / no workflows
} else {
// CREATE
kb.initialize();
kb.setValue('u_source_sys_id', src.sys_id);
kb.setWorkflow(false); // ✅ No emails / no workflows
}
kb.short_description = src.short_description;
kb.text = src.text;
kb.workflow_state = src.workflow_state; // published / retired
if (kb.isNewRecord())
kb.insert();
else
kb.update();
}
})();u_source_sys_id | String (32) |
Please accept the solution and close the tried if this is helpful.
Thanks,
Rithika.ch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi Challa,
Could you please explain how we can achieve this and we have lot of sub tables data means different classes exist in kb _knowledge table. We are pulling that data to another instances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
There are multiple approaches depending on your requirement. Let me walk you through all of them most common method best for Migrating a small set of articles between instances.
- Go to the source instance
- Navigate to System Update Sets → Local Update Sets
- Click New Give it a name (e.g
Knowledge Articles Migration) - Set it as the Current Update Set
- Open each Knowledge Article you want to migrate
- Right-click the form header Click "Add to Update Set"
- Once done, go to the update set Click Complete
- Click Export to XML Save the XML file
On Target Instance
- Go to System Update Sets Retrieved Update Sets
- Click Import Update Set from XML
- Upload the xml
file - Open the retrieved update set Click Preview
- Resolve any conflicts Click Commit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
There are multiple approaches depending on your requirement. Let me walk you through all of them most common method best for Migrating a small set of articles between instances.
- Go to the source instance
- Navigate to System Update Sets → Local Update Sets
- Click New Give it a name
- Set it as the Current Update Set
- Open each Knowledge Article you want to migrate
- Right-click the form header Click "Add to Update Set"
- Once done, go to the update set Click Complete
- Click Export to XML Save the XML file
On Target Instance
- Go to System Update Sets Retrieved Update Sets
- Click Import Update Set from XML
- Upload the xml
file - Open the retrieved update set Click Preview
- Resolve any conflicts Click Commit
