Import a knowledge base from static html files

poornima2
Mega Expert

We would like to import an existing KB article we have saved locally as an HTML file to the Service-Now server and create a new KB.
I was provided a script which is in the wiki (http://wiki.service-now.com/index.php?title=Useful_Scripts#Import_a_knowledge_base_from_static_html_files_.26_rename_all_image_tags). This script is supposed to enable uploading of HTML files(including images) to the KB.
My problem is,i can able to upload the file into the KB,but the images are not visible in the KB article
(The images within the articles are not uploading).If anyone else has had success with such an operation, please let us know.

Thanks.

22 REPLIES 22

Yes, it is a very time consuming process. The script on the Wiki is provided 'as-is' since other people wanted to take a look at what we did, but I remember it being a very difficult endeavor.

I don't believe the script imports images, I think you have to import the image file directory manually, then use the script to change all the image paths from the original html directory to the new Service-now directory.


ethal
Kilo Contributor

How would we go about uploading the image files separately? Could this be accomplished through a script? If so, could we incorporate that into the existing script?


I would open up an incident on /hi with the images directory zipped up as an attachment... if the directory is too big, then I would open up the incident without it and explain that you need them to coordinate a way for you to upload a large file.

Keep in mind that the import knowledge script on the Wiki, and the process I am talking about is a one-time shot. It was a starting point, where all new articles and a large manual 'clean up' of the imported articles needed to take place. When I last did this (about 2 years ago) there was no way to make a scheduled 'job' of automating knowledge syncs or dumps.

I have had customers who reference existing Sharepoint and other knowledge repositories, and that is a straight-forward exercise, but that is not importing those articles into Service-now.



Rob Woodbyrne


We are in exactly the same position at this very moment and any assistance would be greatly appreciated.


marcguy
ServiceNow Employee
ServiceNow Employee

Not sure if this really helps but I have managed to get this done on 3k word docs, imported in the following fashion:
This needed:
Word Cleaner (http://www.convertwordtohtml.com COSTS $99 This converts your word docs to html and images to .png files)
SNC OPS access (to upload the .png files generated from the above app to the uploads folder on the instance)
My own local instance running winter2009
(a local instance for easier uploading of the html files to the uploads folder and b-running winter09 because of recent security improvements has stopped the import script from being allowed to run on newer versions)

SO....with all these things in place, the process then was:
Take all of the word files and running a bulk conversion in the Word Cleaner tool (lots of settings here to tidy up the html but the main one to remember is to save all images using /scs/imagename.png (reason for this is /scs is then used in the html files and SNC knows to look in the uploads folder when searching for this path)

Once all converted to html and images converted to .png files, put them all in the UPLOADS folder in the local instance (or get OPS to upload them to the hosted instances UPLOADS folder, no matter what you do you will need to do this to the .png files)

Then run the script which is mentioned earlier in the forum post, but commenting out the problem process
//total = postProcess(total); //commenting this line out means we don't try to run the image renaming etc which we don't need to do anyways anymore becuase of how we've saved the images and the path etc.

Anyway, once I had my KB Articles in my local instances, I exported them all as XML and then imported them into a hosted instance (the scs/ path for the images works because it's the same in hosted instances)

So we finally have the kb articles uploaded and the customer has started work on giving them a topic/category and tidying them up, the html is not very easy to read due to the conversion but they are quite editable in WYSIWYG view.

As you can see, not an easy process at all and needs SNC resources, but I thought I would share what I know as I keep seeing people asking if it can be done.

Marc