mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-03 17:05:16 +03:00
Add docs for supported import formats (#7064)
Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com>
This commit is contained in:
parent
12c460c00b
commit
1b7d559180
@ -1,80 +1,5 @@
|
||||
## How to Import Documents from Notion
|
||||
### Supported Import Options
|
||||
|
||||
To import Notion documents:
|
||||
1. **Notion**: see [Import from Notion Guide](./notion/README.md)
|
||||
2. **ClickUp**: see [Import from ClickUp Guide](./clickup/README.md)
|
||||
|
||||
1. Export documents from Notion as *Markdown & CSV*
|
||||
2. Extract the exported archive
|
||||
3. 1. If you want your docs to be imported along with Notion teamspaces, use this command:
|
||||
|
||||
|
||||
```
|
||||
rushx run-local import-notion-with-teamspaces ${dir} \
|
||||
--user ${user} \
|
||||
--password ${password} \
|
||||
--workspace ${workspace}
|
||||
```
|
||||
|
||||
3. 2. If you want the docs to be imported to a new teamspace, use this command:
|
||||
|
||||
```
|
||||
rushx run-local import-notion-to-teamspace {dir} \
|
||||
--user ${user} \
|
||||
--password ${password} \
|
||||
--workspace ${workspace} \
|
||||
--teamspace ${teamspace}
|
||||
```
|
||||
|
||||
* *dir* - path to the root of the extracted archive
|
||||
* *user* - your username or email
|
||||
* *password* - password
|
||||
* *workspace* - workspace url where the documents should be imported to
|
||||
* *teamspace* - teamspace to be created for newly imported docs
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
#### For local run:
|
||||
When importing Notion workspace with teamspaces
|
||||
```
|
||||
rushx run-local import-notion-with-teamspaces /home/john/extracted-notion-docs \
|
||||
--user john.doe@gmail.com \
|
||||
--password qwe1234 \
|
||||
--workspace ws1
|
||||
```
|
||||
When importing Notion workspace without teamspaces or a page with subpages
|
||||
```
|
||||
rushx run-local import-notion-to-teamspace /home/john/extracted-notion-docs \
|
||||
--user john.doe@gmail.com \
|
||||
--password qwe1234 \
|
||||
--workspace ws1 \
|
||||
--teamspace imported
|
||||
```
|
||||
|
||||
#### For cloud deployment:
|
||||
##### Here is an example for those who's using huly.app cloud:
|
||||
1. Go to the root folder of the extracted archive with exported data.
|
||||
2. Run import command as follow:
|
||||
|
||||
* To import Notion workspace with teamspaces
|
||||
```
|
||||
docker run \
|
||||
-e FRONT_URL="https://huly.app" \
|
||||
-v $(pwd):/data \
|
||||
hardcoreeng/import-tool:latest \
|
||||
-- bundle.js import-notion-with-teamspaces /data \
|
||||
--user jane.doe@gmail.com \
|
||||
--password 4321qwe \
|
||||
--workspace ws1
|
||||
```
|
||||
* To import Notion workspace without teamspaces or a page with subpages.
|
||||
```
|
||||
docker run \
|
||||
-e FRONT_URL="https://huly.app" \
|
||||
-v $(pwd):/data \
|
||||
hardcoreeng/import-tool:latest \
|
||||
-- bundle.js import-notion-to-teamspace /data \
|
||||
--user jane.doe@gmail.com \
|
||||
--password 4321qwe \
|
||||
--workspace ws1 \
|
||||
--teamspace notion
|
||||
```
|
32
dev/import-tool/src/clickup/README.md
Normal file
32
dev/import-tool/src/clickup/README.md
Normal file
@ -0,0 +1,32 @@
|
||||
## Import from ClickUp Guide
|
||||
|
||||
### Export Data from ClickUp
|
||||
|
||||
1. Follow [ClickUp's official guide](https://help.clickup.com/hc/en-us/articles/6310551109527-Task-data-export) to export your tasks as CSV
|
||||
2. Save the CSV file to your local machine
|
||||
|
||||
### Run Import Tool
|
||||
1. Place your ClickUp CSV file in a directory (e.g., /path/to/export)
|
||||
2. Run the import tool using Docker:
|
||||
|
||||
```
|
||||
docker run \
|
||||
-e FRONT_URL="https://huly.app" \
|
||||
-v /path/to/export:/data \
|
||||
hardcoreeng/import-tool:latest \
|
||||
-- bundle.js import-clickup-tasks /data/tasks.csv \
|
||||
--user your.email@company.com \
|
||||
--password yourpassword \
|
||||
--workspace workspace-id
|
||||
```
|
||||
|
||||
#### User Mapping
|
||||
* Users must be created in the platform before import
|
||||
* ClickUp assignees are mapped to platform users by full name (e.g., "Jane Doe")
|
||||
* If user is not found:
|
||||
* Task will be imported without assignee
|
||||
* Original assignee name will be added as a comment: *ClickUp assignee: John Smith*
|
||||
|
||||
#### Limitations
|
||||
* Checklist items are imported as unchecked since ClickUp export doesn't include checkbox states
|
||||
* Failed attachment downloads are skipped with warning messages (Original attachment URL is added as a comment)
|
@ -16,7 +16,7 @@ import contact, { type Person, type PersonAccount } from '@hcengineering/contact
|
||||
import { type Ref, type Timestamp, type TxOperations } from '@hcengineering/core'
|
||||
import { MarkupNodeType, traverseNode, type MarkupNode } from '@hcengineering/text'
|
||||
import csv from 'csvtojson'
|
||||
import { download } from './importer/dowloader'
|
||||
import { download } from '../importer/dowloader'
|
||||
import {
|
||||
WorkspaceImporter,
|
||||
type ImportComment,
|
||||
@ -24,8 +24,8 @@ import {
|
||||
type ImportProject,
|
||||
type ImportProjectType,
|
||||
type MarkdownPreprocessor
|
||||
} from './importer/importer'
|
||||
import { type FileUploader } from './importer/uploader'
|
||||
} from '../importer/importer'
|
||||
import { type FileUploader } from '../importer/uploader'
|
||||
|
||||
interface ClickupTask {
|
||||
'Task ID': string
|
@ -20,10 +20,10 @@ import serverClientPlugin, {
|
||||
selectWorkspace
|
||||
} from '@hcengineering/server-client'
|
||||
import { program } from 'commander'
|
||||
import { importNotion } from './notion'
|
||||
import { importNotion } from './notion/notion'
|
||||
import { setMetadata } from '@hcengineering/platform'
|
||||
import { FrontFileUploader, type FileUploader } from './importer/uploader'
|
||||
import { ClickupImporter } from './clickup'
|
||||
import { ClickupImporter } from './clickup/clickup'
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
44
dev/import-tool/src/notion/README.md
Normal file
44
dev/import-tool/src/notion/README.md
Normal file
@ -0,0 +1,44 @@
|
||||
## Import from Notion Guide
|
||||
|
||||
### Export Data from Notion
|
||||
|
||||
1. Follow [Notion's official guide](https://www.notion.so/help/export-your-content) to export your content
|
||||
2. Important: Select **Markdown & CSV** export format
|
||||
3. Extract the exported archive to a local directory
|
||||
|
||||
### Run Import Tool
|
||||
|
||||
1. Place your extracted Notion export in a directory (e.g., `/path/to/export`)
|
||||
2. Choose one of two import options:
|
||||
#### Option 1: Import with Original Teamspace Structure
|
||||
```
|
||||
docker run \
|
||||
-e FRONT_URL="https://huly.app" \
|
||||
-v /path/to/export:/data \
|
||||
hardcoreeng/import-tool:latest \
|
||||
-- bundle.js import-notion-with-teamspaces /data \
|
||||
--user your.email@company.com \
|
||||
--password yourpassword \
|
||||
--workspace workspace-id
|
||||
```
|
||||
#### Option 2: Import to Single Teamspace
|
||||
```
|
||||
docker run \
|
||||
-e FRONT_URL="https://huly.app" \
|
||||
-v /path/to/export:/data \
|
||||
hardcoreeng/import-tool:latest \
|
||||
-- bundle.js import-notion-to-teamspace /data \
|
||||
--user your.email@company.com \
|
||||
--password yourpassword \
|
||||
--workspace workspace-id \
|
||||
--teamspace teamspace-name-to-be-created
|
||||
```
|
||||
|
||||
#### Limitations
|
||||
* Notion databases are not imported (CSV format not supported)
|
||||
* Comments are not included in Notion exports, so they will not be imported
|
||||
* Images and files must be included in the export to be imported
|
||||
#### Notes
|
||||
* All documents preserve their hierarchy
|
||||
* Internal links between documents are maintained
|
||||
* Images and attachments are imported automatically if present in export
|
@ -42,7 +42,7 @@ import { type Dirent } from 'fs'
|
||||
import { readdir, readFile, stat } from 'fs/promises'
|
||||
import { contentType } from 'mime-types'
|
||||
import { basename, join, parse } from 'path'
|
||||
import { type FileUploader } from './importer/uploader'
|
||||
import { type FileUploader } from '../importer/uploader'
|
||||
|
||||
interface DocumentMetadata {
|
||||
id: string
|
Loading…
Reference in New Issue
Block a user