JetBrains Space Help

Import Documents

Space has a ready-to-use script that you can use to import documents into your Space project from the following external sources:

  • You local folder

  • Atlassian Confluence

The script is publicly available as a Docker image and can be run with a number of arguments right from your terminal.

If you'd like to customize the script and build your own image, you can access the source code on GitHub at: https://github.com/JetBrains/space-documents-import

Import documents from a local folder

When importing documents from your local folder:

  • You need to provide your Space personal token which you can obtain beforehand.

  • You specify your local folder as source and your Space project as a destination. You cannot specify individual files. All files from the source folder are imported into the root documentation folder of your Space project.

  • Only .md files appear in Space as Space documents - they can be viewed and edited right in Space. All other types of files are uploaded and stored as Space files - they cannot be edited in Space.

Preparation

  1. Permissions. Make sure you have sufficient rights in your destination Space project, as the script will access it on your behalf. In your Space project you must have the View documents, Edit documents, Create documents permissions.

  2. Authentication. You need a personal access token from Space. You will provide it as an argument value when you run the script. To get a personal token, please follow these instructions. If you choose limited access for the token, you’ll have to give it the View documents, Edit documents, Create documents permissions.

  3. Docker. You need a Docker instance installed and running on your machine. If you don't have it, refer to the installation guide.

Run the script

The script is stored as a Docker image in a public registry at public.registry.jetbrains.space. Run the image by executing a docker run command in your terminal.

$ docker run --rm -it \ -v <Local Folder Path>:/root/documents \ public.registry.jetbrains.space/p/space/containers/space-documents-import folder \ --folder /root/documents \ --space-server https://<domain>.jetbrains.space \ --space-project-key <Space Project Key> \ --space-token <Space Access Token>

Arguments

Argument

Description

Is required

-v <Local Folder Path>

The path to your local directory that contains the files you want to import.

Required

--space-server https://<domain>.jetbrains.space

Your Space organization URL, e.g. mycompany.jetbrains.space

Required

--space-project-key <Space Project Key>

The key of your Space destination project.

To look up the project key:

  1. Navigate to your Space project.

  2. On the project sidebar, choose Settings.

  3. Go to the Info tab.

Required

--space-token <Space Access Token>

Space personal access token.

To create and copy a token, follow these instructions.

If you choose limited access when creating a token, you’ll have to give it the View documents, Edit documents, Create documents permissions.

Required

Import documents from Confluence

When importing documents from your local folder:

  • You need to provide your Space personal token which you can obtain beforehand.

  • You specify the URL of your Confluence space as source and your Space project as a destination. You cannot specify individual files. All files from the source are imported into the root documentation folder of your Space project.

Preparation

  1. Permissions. Make sure you have sufficient rights in your destination Space project and your source Confluence space, as the script will access them on your behalf. In your Space project you must have the View documents, Edit documents, Create documents permissions. In Confluence, you need the reading access to the location of the files you want to import.

  2. Authentication. You need a personal access token from Space. You will provide it as an argument value when you run the script. To get a personal token, please follow these instructions. If you choose limited access for the token, you’ll have to give it the View documents, Edit documents, Create documents permissions.

    You also need your Confluence username and password.

  3. Docker. You need a Docker instance installed and running on your machine. If you don't have it, refer to the installation guide.

Run the script

The script is stored as a Docker image in a public registry at public.registry.jetbrains.space. Run the image by executing a docker run command in your terminal.

$ docker run --rm -it \ public.registry.jetbrains.space/p/space/containers/space-documents-import confluence \ --confluence-url https://<Confluence Space URL> \ --confluence-space-key "<Confluence Space Key>" \ --confluence-username <Confluence Username> \ --confluence-password <Confluence Password> \ --space-server https://<domain>.jetbrains.space \ --space-project-key <Space Project Key> \ --space-token <Space Access Token>

Arguments

Argument

Description

Is required

--confluence-url https://<Confluence Space URL>

The URL of your Confluence space which contains the documents you want to import.

Required

--confluence-space-key "<Confluence Space Key>"

The key of your Confluence space which contains the documents you want to import.

Required

--confluence-username <Confluence Username>

Your username in Confluence.

Required

--confluence-password <Confluence Password>

Your password in Confluence.

Required

--space-server https://<domain>.jetbrains.space

Your Space organization URL, e.g. mycompany.jetbrains.space

Required

--space-project-key <Space Project Key>

The key of your Space destination project.

To look up the project key:

  1. Navigate to your Space project.

  2. On the project sidebar, choose Settings.

  3. Go to the Info tab.

Required

--space-token <Space Access Token>

Space personal access token.

To create and copy a token, follow these instructions.

If you choose limited access when creating a token, you’ll have to give it the View documents, Edit documents, Create documents permissions.

Required

Last modified: 15 December 2023