# Migrate to Docsheaf

Bring your existing docs from GitBook, a Git repository or a folder of Markdown.

Docsheaf reads GitBook's Markdown format — `SUMMARY.md`, `.gitbook.yaml`, nested `README.md`
pages, front matter and the `{% hint %}`, `{% tabs %}`, `{% stepper %}` family of blocks — so most
GitBook content moves over without edits.

{% tabs %}
{% tab title="From a GitBook export or ZIP" %}
1. Export your GitBook space as Markdown, or download your repository as a ZIP (GitHub's
   **Code → Download ZIP** works as it is).
2. In Docsheaf, open the space and choose **Import a folder (.zip)** from the space menu.
3. Read the preview: the page outline, the counts, files left out, images the pages point to
   that the archive lacks, and links that don't lead to an imported page.
4. Confirm. The pages are added after the ones already in the space — nothing is replaced.

Images and files the pages use are uploaded with them, and links between pages keep working.
{% endtab %}

{% tab title="From a Git repository" %}
Connect the space's site to the repository with [Git Sync](git-sync), give the space
the folder that holds the Markdown, and choose **Git → Docsheaf** as the first sync. Docsheaf reads the folder and keeps the space and the branch in step
from then on: pushes come in, published changes go out as commits.
{% endtab %}

{% tab title="One page at a time" %}
Choose **Import Markdown, Word or HTML** from the space menu (or from a page's menu, to import under
that page). Word documents (`.docx`) and HTML are converted in your browser.
{% endtab %}
{% endtabs %}

## What carries over

| From GitBook | In Docsheaf |
| --- | --- |
| `SUMMARY.md` headings | Groups |
| Nested `README.md` | A page with sub-pages |
| Front matter `description`, `cover`, `hidden`, emoji `icon` | Page fields of the same name |
| Hints, tabs, steppers, expandables, cards, columns, embeds, files, math | The same [blocks](blocks) |
| `{% content-ref %}` | Page link cards |
| `{% openapi %}` and the older `{% swagger %}` | [OpenAPI blocks](document-an-api) |
| `{% if %}` conditions | [Conditional content](adaptive-content) |
| `.gitbook/assets/` | Uploads |

{% hint style="warning" %}
GitBook `icon:` values that name an icon (rather than an emoji) are dropped. Set an emoji on those
pages after the import.
{% endhint %}

## Limits

An archive can be up to 20 MB, 5,000 files and 2,000 pages; Markdown files over 2 MB are left out
and listed in the preview. A space holds up to 10,000 pages, 16 levels deep.
