#15717

Import does not restore the folder tree, and pages cannot be moved into folders

Opensergeymesilovopened 11d ago

Import does not restore the folder tree, and pages cannot be moved into folders

Version: 0.27.4 (self-hosted Docker, ghcr.io/toeverything/affine:stable), import performed in the web app (Chrome), same result in the desktop app.

What happened

I imported an Obsidian vault (939 pages: 849 markdown notes + 84 canvas conversions) using Markdown with media files (.zip) in several batches. Import reports Import completed and all pages exist — doc_search/read_document find them, and they are all listed under All docs.

But the sidebar tree does not match the source:

  • folders are created from the zip paths and appear with the right names (techniques, troubleshooting, tools, sources, research, references);
  • the documents are not placed inside them — e.g. research/videos shows "Empty folder" although all 69 pages from that folder exist in the workspace;
  • two sibling folders with the same name appear (sources twice) after importing the same source folder in two archives.

Expected: pages from research/videos/*.md appear under research/videos in the sidebar.

Actual: pages land at the root of All docs; folders are empty shells.

There is also no way to fix it from the UI:

  • row menu (doc-list-operation-button) contains only Add to favourites, View Info, Open in new tab, Duplicate, Move to trash — no "Move to folder";
  • selecting all documents (740 selected) shows only Clear selection — no bulk action.

So the imported structure can only be rebuilt by hand, one drag at a time.

Reproduction

  1. Create a vault with research/videos/a.md, research/videos/b.md.
  2. Pack it as a zip and import it via Import → Markdown with media files (.zip).
  3. Open the sidebar: research/videos is present and empty; a and b are in All docs.

Environment

  • self-hosted Docker, image ghcr.io/toeverything/affine:stable, Postgres 16 + Redis + Manticore
  • import from the web app on http://localhost:3010, Chrome 141
  • workspace_pages after import: 939 rows; the pages exist, only their parent is wrong.

Related code (for reference)

  • blocksuite/affine/widgets/linked-doc/src/transformers/obsidian.ts:863-868 — importer reads file.webkitRelativePath || file.name and creates docs; the parent assignment is not derived from that path.

Activity

1
affine-issue-bot[bot]11d ago

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.