Moving articles from one knowledge base to another

Maria Gabriel
Tera Contributor

We are going to retire a knowledge base and we're looking to move articles to another.  Is there an easy way to do this without going through checking out, updating knowledge base and re-publishing the articles?

I was thinking of maybe doing this via script. What is the proper way of doing this?

Thanks.

4 REPLIES 4

jessealexander
Kilo Contributor

I have the same question but for the Quebec version. Is there a script that can do this? An answer to a similar article says that you can use

if(knowledge base)

current.setValue('kb', '');

Does anyone know if this is correct?

SimonW1
Giga Contributor

Not sure if you ever got this to work, but there is a fairly useful Service now published Knowledge article on this subject 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0852780

 

When given a list of knowledge articles and destination sysids for the Knowledge base and the category, it will move all published versions of an article to the target location. 

 

If anyone has any idea on how to move *ALL* versions of an article I'd be most interested to read them.

I know this is a bit late, but I was able to modify the script in this article: 
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0852780

Simply change the 'moveKBArticle' function to this:
function moveKBArticle(kbNumber) {
var kb = new GlideRecord('kb_knowledge');
kb.autoSysFields(false);
kb.setWorkflow(false);
kb.addQuery('number', kbNumber);
kb.query();
if (!kb.hasNext()){
gs.info('Did not find ' + kbNumber);

return;
}
while (kb.next()) {
kb.kb_knowledge_base = TARGET_KB_SYS_ID;
kb.kb_category = TARGET_KB_CATEGORY;
kb.update();
gs.info('Moved ' + kbNumber + ' to Knowledge Base ' + TARGET_KB_SYS_ID);
}
}

This should loop through all article versions.

Thanks for the help.