How to move KB articles from one instance to other instance through script with attachments?

vl92
Kilo Contributor

Hi All,

Can any one please help me on the below task.

How to move KB articles from one instance to other instance through script with attachments?

Is it possible, any one know please guide me on that.

Thanks in advance.

19 REPLIES 19

Kamal17
Kilo Sage

Hi Varalakshmi,



I worked on the same requirement few months back. One of the methods which i used is capturing KB articles in an update set and committing the update set in target instance. You can follow the below steps to achieve the same.



1. Create an update set Eg 'KB_Migration_1' and set it as current update set.


2. Open background script and execute the below script.


Script


var gr = new GlideRecord('kb_knowledge');


gr.addQuery('active',true);


gr.setLimit(50);//Its better limit the records to avoid timeout issues


gr.query();



while(gr.next()){


var upd = new GlideUpdateManager2();


upd.saveRecord(gr);


}


3. After capturing the desired KB articles, mark the update set as complete, push it to the target instance and commit the same


4. KB articles will get imported in the target instance with attachments, related lists info, etc..



Apart from the above method you may also use XML export/import but it won't include related lists and attachments. You have to write a separate script to include those details. So i would suggest to go ahead with update set as it makes your migration easier.



-Udhay


Please Hit like, Helpful or Correct depending on the impact of the response


That doesnt work at all. 

Nothing is captured in the U/S

This worked and save lots of time for me. Thank you.

Does this really capture the attachments? I doubt. Because attachments are data and only configurations are suppose to get captured in the update set right? Correct me if I am wrong. Experts can comment!

 

Regards,

Anish