diff --git a/dev/import-tool/README.md b/dev/import-tool/README.md index 75088e2ad0..b73bfe9ae1 100644 --- a/dev/import-tool/README.md +++ b/dev/import-tool/README.md @@ -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 -``` \ No newline at end of file diff --git a/dev/import-tool/src/clickup/README.md b/dev/import-tool/src/clickup/README.md new file mode 100644 index 0000000000..d2e28a7c6e --- /dev/null +++ b/dev/import-tool/src/clickup/README.md @@ -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) diff --git a/dev/import-tool/src/clickup.ts b/dev/import-tool/src/clickup/clickup.ts similarity index 98% rename from dev/import-tool/src/clickup.ts rename to dev/import-tool/src/clickup/clickup.ts index 6fe978d06d..191d71e964 100644 --- a/dev/import-tool/src/clickup.ts +++ b/dev/import-tool/src/clickup/clickup.ts @@ -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 diff --git a/dev/import-tool/src/index.ts b/dev/import-tool/src/index.ts index 23a670f213..cf8ab5f456 100644 --- a/dev/import-tool/src/index.ts +++ b/dev/import-tool/src/index.ts @@ -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 diff --git a/dev/import-tool/src/notion/README.md b/dev/import-tool/src/notion/README.md new file mode 100644 index 0000000000..3ffd297d78 --- /dev/null +++ b/dev/import-tool/src/notion/README.md @@ -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 \ No newline at end of file diff --git a/dev/import-tool/src/notion.ts b/dev/import-tool/src/notion/notion.ts similarity index 99% rename from dev/import-tool/src/notion.ts rename to dev/import-tool/src/notion/notion.ts index fc6beb88c8..1ac2aedb0f 100644 --- a/dev/import-tool/src/notion.ts +++ b/dev/import-tool/src/notion/notion.ts @@ -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