> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/getting-started/import.md).

# GitBook への移行

Confluence、Notion、Git などから既存コンテンツを GitBook に取り込む方法

インポートツールを使用して、GitBook内の既存ドキュメントを移行し、一元化できます。

組み込みのインポートツールを使って1ページまたは複数ページをインポートすることも、 [Git Syncを使ってGitリポジトリ全体をインポートすることもできます。](#import-using-git-sync).

## インポートパネルの使用

インポートパネルを使うと、別のドキュメントサイトや既存ファイルからコンテンツをGitBook組織へ簡単に移行できます。

別のオンラインドキュメントサイトからインポートする場合は、サイトのURLを追加するだけで、あとはGitBookが処理します。

既定では、GitBookはAIを使用してインポートプロセスを効率化します。これにより、GitBookの形式に完全には一致しないインポート済みコンテンツが賢く整えられ、クリーンアップされます。つまり、出力はより洗練され、GitBookのブロックをより効果的に使うようになります。これはメニューから無効にできます。

### 対応しているインポート形式

GitBookは、以下の形式のドキュメントサイトまたはファイルからのインポートをサポートしています：

* Markdown（`.md` または `.markdown`)
* HTML（`.html`)
* Microsoft Word（`.docx`)

GitBookは以下からのインポートもサポートしています：

* Confluence
* Notion
* GitHub Wiki
* Quip
* Dropbox Paper
* Google ドキュメント

複数のページを **インポートする**場合は、HTMLファイルまたはMarkdownファイルを含むZIPファイルをアップロードするか、 **オンラインドキュメント** のインポートオプションを使用できます。

{% hint style="info" %}
GitBookはMarkdownベースなので、Markdown形式でコンテンツをインポートすると最良の結果が得られます。現在お使いのツールがMarkdownでの書き出しに対応している場合は、よりスムーズにインポートするためにその形式の使用をおすすめします。
{% endhint %}

### インポートパネル

<figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-fee6329e5d4ed9522490f472129a8a1a1efceea1%2F25_12_10_import%402x.png?alt=media" alt="A GitBook screenshot showing the import panel"><figcaption><p>GitBookのインポートパネル。</p></figcaption></figure>

新しいセクションを作成すると、表示されるモーダルでコンテンツをインポートできます。空のセクションを作成した場合は、新しい空のページの下部にある **クイックスタート** セクションからもインポートできます。 **編集**.

または、 **新規追加** > **ページをインポート** を目次の下部から選択するか、ページの [目次](https://gitbook.com/docs/documentation/ja-gitbook-documentation/rifarensu/gitbook-ui.md#table-of-contents)を開いて、 **アクションメニュー** <picture><source srcset="broken://files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> から **サブページをインポート**.

入力元を選択した後、インポートしたいファイルを選択できます。

{% hint style="warning" %}
GitBookはさまざまなソースからコンテンツをインポートしますが、製品機能やドキュメント形式の違いにより、インポートされたコンテンツが元のソースと比べて異なる場合があります。
{% endhint %}

### 制限事項

現在、GitBookにはインポート済みコンテンツに次の制限があります：

* 1回のインポートでアップロードできるページ数の上限は **20**.
* 1回のインポートでアップロードできるファイル（画像など）の最大数は **20**.

GitBookでは、これらのインポート上限を引き上げることはできません。一度により多くのコンテンツをインポートするには、 [Git Sync](https://gitbook.com/docs/documentation/ja-gitbook-documentation/docs-as-code/git-sync.md)を使用してください。最大5,000件のMarkdownページに対応しています。

***

## Git Syncを使用してGitHubまたはGitLabリポジトリからインポート <a href="#import-using-git-sync" id="import-using-git-sync"></a>

大量のコンテンツをGitBookにインポートする場合は、 [Git Sync](https://gitbook.com/docs/documentation/ja-gitbook-documentation/docs-as-code/git-sync.md)の使用をおすすめします。組み込みの移行ツールでも大半のインポートに対応できますが、大規模な移行を効率よく行うにはGit Syncが適しています。

{% hint style="info" %}
コンテンツをインポートするための基本的な手順を以下に示します。詳しい手順や動画デモについては、 [Git Syncを使ってGitBookにコンテンツをインポートする](https://gitbook.com/docs/guides/editing-and-publishing-documentation/import-or-migrate-your-content-to-gitbook-with-git-sync.md).
{% endhint %}

{% stepper %}
{% step %}
**コンテンツをMarkdownに変換する**

GitBookはMarkdownベースなので、Markdown形式でコンテンツをインポートすると最良の結果が得られます。現在お使いのツールがMarkdownでの書き出しに対応している場合は、よりスムーズにインポートするためにその形式の使用をおすすめします。

コンテンツがすでにMarkdownファイルになっていない場合は、スクリプト（ [Markitdown](https://github.com/microsoft/markitdown)など）またはオンラインツールを使って変換することをおすすめします。
{% endstep %}

{% step %}
**GitHubまたはGitLabでコンテンツを整理する**

GitBookサイトを設定する際は、GitHubまたはGitLabリポジトリ内でコンテンツを効率的に整理することが重要です。Git Syncはセクション単位で行われるため、コンテンツのグループ化方法を慎重に計画してください。複数のリポジトリやフォルダを作成し、必要なMarkdownファイルが正しい場所にあることを確認します。
{% endstep %}

{% step %}
**セクションを設定し、Git Syncを構成する**

コンテンツを整理するには、必要に応じてGitBookに1つ以上のセクションを作成します。組織に [GitHub Sync](https://www.gitbook.com/integrations/github-sync) または [GitLab Sync](https://www.gitbook.com/integrations/gitlab-sync) のインテグレーションをインストールし、それらのセクション用に設定します。前の手順で設定したフォルダーまたはリポジトリとセクションを同期する必要があります。
{% endstep %}

{% step %}
**Git SyncをGitHub → GitBookの方向で実行する**

設定手順に従う際は、必ずGitHub → GitBookの方向を選択してください。これにより、フォルダまたはリポジトリの内容がGitHubまたはGitLabからGitBookに取り込まれます。
{% endstep %}
{% endstepper %}

## コンテンツをエクスポートする

GitBookのコンテンツは2つの方法でエクスポートできます：

* **Markdownとして**Gitリポジトリと同期してエクスポートします。アプリからMarkdownを直接エクスポートすることはできません。エクスポートするセクションを、 [Git Sync](https://gitbook.com/docs/documentation/ja-gitbook-documentation/docs-as-code/git-sync.md)。リポジトリがMarkdownエクスポートになります。Markdown形式で表現できないブロックは、エクスポート内でHTMLとして表示されます。
* **PDFとして**。ページまたはセクションの「アクション」メニューから実行できます。詳しくは、 [PDFエクスポート](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/pdf-export.md)をご覧ください。非常に大きなセクションをエクスポートすると、制限に達することがあります。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/getting-started/import.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
