How to import from guru cards to confluence pages

Marlon Muela
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 18, 2022

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?

3 answers

1 accepted

4 votes
Answer accepted
Elizabeth Barr
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 18, 2022

Welcome, @Marlon Muela. I happen to have experience with Guru (exporting content into it and exporting content out of it).

For context, @Nic Brough -Adaptavist-, 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 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 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!

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2022

Thanks for helping out!

Like Elizabeth Barr likes this
Renee Niewald January 25, 2024

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.

1 vote
Fabio Germann January 13, 2023

@Marlon MuelaI 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 for the hint with the ZIP file - it inspired me to write the importer.

Elizabeth Barr
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 13, 2023

AWESOME, @Fabio Germann !!!!

Like Sarah Wright likes this
Drew Morone November 14, 2023

@Fabio Germann 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!


Fabio Germann
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 14, 2023

Hi @Drew Morone 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.

Drew Morone November 15, 2023

And it works! Thanks Fabio!

Drew Morone November 16, 2023

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'

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2022

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events