How to import from guru cards to confluence pages
Asked by Marlon Muela:

I have a list of guru cards that we have exported in csv format. I could not find a way to migrate cards from guru into space pages. There is a thread that redirects to this link: <https://confluence.atlassian.com/confkb/how-to-import-a-third-party-knowledge-base-943523632.html>. However, the link suggests to have it in separate text files for importing with XHTML format.

I checked confluence settings, but I could not find Content Tools \> Import (asking for the text file from the directory) from this link: <https://confluence.atlassian.com/doc/import-a-text-file-139492.html>

The only option to import is from Word, Google Doc or OneDrive.

How can I migrate or import downloaded text files as pages in confluence?


Answers:
author: Elizabeth Barr
body: Welcome, [@Marlon Muela](/t5/user/viewprofilepage/user-id/4932874). I happen to have experience with Guru (exporting content into it and exporting content out of it).

For context, [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454), Guru cards are their smallest unit of content. Like Confluence sites are made of spaces that have pages, Guru has collections (divided into boards made up of cards).

Unsurprisingly, their help center doesn't make it easy to find out how to remove Guru content and bring it somewhere else ;)

Using [this](https://intercom.help/getguru/en/articles/4739554-exporting-a-guru-collection-as-a-zip-file?) method, you will get a zip with HTML and YAML versions of your content. I see that you're on Confluence Cloud, so the[short answer](https://support.atlassian.com/confluence-cloud/docs/import-content-into-confluence-cloud/) from our help docs is: **"If you have web content that you want to import into Confluence, you'll need to import it page by page."** HTML= web content.

There may be other methods you can use to convert the HTML or YAML files from Guru to Word documents for easy import into Confluence, but none that I'm aware of off the top of my head. Let us know how it goes!

comments: author: Nic Brough -Adaptavist-
body: Thanks for helping out!


author: Renee Niewald
body: Any chance someone has the info in that was originally in the "This" link <https://intercom.help/getguru/en/articles/4739554-exporting-a-guru-collection-as-a-zip-file%C2%A0>   

It says "Not Found" now.


author: Fabio Germann
body: [@Renee Niewald](/t5/user/viewprofilepage/user-id/4898795)check this link from the google cache (Salesforce took over Guru and now all docs are behind a login): [https://webcache.googleusercontent.com/search?q=cache%3Ahttps%3A%2F%2Fhelp.getguru.com%2Fs%2Farticle%2Fexporting-a-guru-collection-as-a-zip-file\&rlz=1C5GCEM_enCA1037CA1041\&oq=cache%3Ahttps%3A%2F%2Fhelp.getguru.com%2Fs%2Farticle%2Fexporting-a-guru-collection-as-a-zip-file](https://webcache.googleusercontent.com/search?q=cache%3Ahttps%3A%2F%2Fhelp.getguru.com%2Fs%2Farticle%2Fexporting-a-guru-collection-as-a-zip-file&rlz=1C5GCEM_enCA1037CA1041&oq=cache%3Ahttps%3A%2F%2Fhelp.getguru.com%2Fs%2Farticle%2Fexporting-a-guru-collection-as-a-zip-file)


author: Fabio Germann
body: [@Marlon Muela](/t5/user/viewprofilepage/user-id/4932874)I had the same issue and created an importer.

Once you exported the collection as ZIP file and download/extract it you can use:  
<https://github.com/fabiogermann/guru-confluence-importer>

Thanks [@Elizabeth Barr](/t5/user/viewprofilepage/user-id/4738329) for the hint with the ZIP file - it inspired me to write the importer.

comments: author: Elizabeth Barr
body: AWESOME, [@Fabio Germann](/t5/user/viewprofilepage/user-id/817018) !!!!


author: Drew Morone
body: [@Fabio Germann](/t5/user/viewprofilepage/user-id/817018) Thanks for writing this script.   

I believe I have all of my arguments properly defined, however when I run the script, it immediately prints the arguments, then exits. It doesn't get as far as connecting to the API. I'm not getting any error messages. I'm wondering if the

I'm assuming the folowing:  
--collection-dir = the directory containing the 'collection.yaml' file and the associated subdirs that were unzipped from the guru collection export  

I'm able to validate the api with curl, so I don't think it's a connectivity issue.   

I know it's not a lot of info, but any ideas?  

Thanks!  

<br />


author: Fabio Germann
body: Hi [@Drew Morone](/t5/user/viewprofilepage/user-id/5364507) could you open a bug on GitHub and add some details regarding the output/error message. I'd be happy to help as best as I can.

UPDATE: The issue was due to a change in export format on Guru side - the script was adapted and works again.


author: Drew Morone
body: And it works! Thanks Fabio!


author: Drew Morone
body: Fabio, We're having successful imports. Real time saver. Thanks again. Just a few things that you may want to know.   

The script imports images and pdf no problem, but skips xlsx and docx attachments.  

On some collections we run into the error below. Not sure why, because the actual file names are not very long, and the one referenced doesn't exist.   

We can probably get around those issues, just wanted to let you know. Thanks again for providing this script!  

edit: Just wanted to add that we tested this on Windows and a Mac. I'm not sure but I think they both have a 250 char limit on files. I believe we can disable this in python,so we'll try that.

UPLOADED 0?ui=2\&ik=7df771f815\&attid=0.0.1\&permmsgid=msg-a:r-1648421199241673849\&th=1853afe2075265a2\&view=fimg\&fur=ip\&sz=s0-l75-ft\&attbid=ANGjdJ-uUttptshcErt7c0h_BxA2JmB0HEMlWgdN8FL-AtqF6tKTP1XRoczpygIOMostPTHC7Dh7Xb76jAmukgN-QnWRCSJwBxTdZit_UBi2EI12t7KhMAez7-bMAKo\&disp=emb\&realattid=ii_lbyaq1eu5

Traceback (most recent call last):

File "/Users/andrewmorone/guru-confluence-importer/guruCollectionToConfluence.py", line 370, in \<module\>

create_node(page, args.org, args.spacekey, args.username, args.apikey, args.collectiondir)

File "/Users/andrewmorone/guru-confluence-importer/guruCollectionToConfluence.py", line 294, in create_node

create_node(page, organization, space, user_name, user_credentials, collections_dir)

File "/Users/andrewmorone/guru-confluence-importer/guruCollectionToConfluence.py", line 294, in create_node

create_node(page, organization, space, user_name, user_credentials, collections_dir)

File "/Users/andrewmorone/guru-confluence-importer/guruCollectionToConfluence.py", line 274, in create_node

upload_attachment_for_confluence_page(organization, new_page_id, user_name, user_credentials, image,

File "/Users/andrewmorone/guru-confluence-importer/guruCollectionToConfluence.py", line 168, in upload_attachment_for_confluence_page

if not Path(file_path).is_file():

\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^

File "/opt/homebrew/Cellar/python@3.11/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 1267, in is_file

return S_ISREG(self.stat().st_mode)

\^\^\^\^\^\^\^\^\^\^\^

File "/opt/homebrew/Cellar/python@3.11/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 1013, in stat

return os.stat(self, follow_symlinks=follow_symlinks)

\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^

OSError: \[Errno 63\] File name too long: '/Users/andrewmorone/gurucol/hr/resources/0?ui=2\&ik=7df771f815\&attid=0.0.1\&permmsgid=msg-a:r-1648421199241673849\&th=1853afe2075265a2\&view=fimg\&fur=ip\&sz=s0-l75-ft\&attbid=ANGjdJ-uUttptshcErt7c0h_BxA2JmB0HEMlWgdN8FL-AtqF6tKTP1XRoczpygIOMostPTHC7Dh7Xb76jAmukgN-QnWRCSJwBxTdZit_UBi2EI12t7KhMAez7-bMAKo\&disp=emb\&realattid=ii_lbyaq1eu5'


author: Nic Brough -Adaptavist-
body: Welcome to the Atlassian Community!

Confluence is a wiki, a documentation system, it's not for handling lists of things like CSV, spreadsheet, issue trackers etc are.

It's expecting imports of text (often with some level of formatting). You could "import" a CSV file as text, but all that will do is give you a page with a block of CSV as the content.

What data are your "guru cards" representing? (Forgive me, I've not worked with that before and I don't know).

If it is exportable as CSV, it suggests it's likely to be issues (especially as it uses the word "card" which is a common way to describe issues in certain views in issue trackers), which I'd be looking to import into Jira.

But if it really is a knowledge base, then I'd expect an export to drop each article out as a separate file, or in an XML format that includes all the metadata. If it is something like one line of CSV per article, then you would need to convert that into a more knowledge-base style structure - exporting each line as a single text file is the obvious one that Confluence could then import as separate pages.


Tags: cloud

confluence-cloud