Skip to article frontmatterSkip to article content

Upgrade an existing book from Jupyter Book 1

Use automated tools to upgrade a legacy (Sphinx-based) Jupyter Book project to the new MyST Document Engine.

tl;dr to upgrade

Should You Upgrade?

Upgrade for:

Stay on 1.0 if you rely on:

What You Need to Know

Jupyter Book 1 uses two configuration files:

Jupyter Book 2 uses one:

The upgrade process automatically converts these files for you.

Example: A typical Jupyter Book 1 project (https://github.com/jupyter-book/legacy-demo-book/):

_config.yml      # Book metadata and settings
_toc.yml         # Table of contents
intro.md
notebooks.ipynb
logo.png

Contents of a Jupyter Book 1 directory

How to Upgrade

Step 1: Install Jupyter Book 2

pip install jupyter-book
jupyter book --version  # Should show v2...

Step 2: Run the upgrade command

Navigate to your book directory and run:

cd my-book
jupyter book

The CLI will detect your Jupyter Book 1 project and prompt you to upgrade:

? 📘 Found a legacy Jupyter Book. To proceed, myst needs to perform an upgrade which will:
‣ Upgrade any Sphinx-style glossaries to MyST-style glossaries
‣ Upgrade any case-insensitive admonition names to lowercase (Note → note)
‣ Migrate configuration from _config.yml and (if applicable) _toc.yml files
‣ Rename any modified or unneeded files so that they are hidden

Are you willing to proceed? (Y/n)

Upgrade prompt

Step 3: Accept the upgrade

Press Y to start the upgrade. The tool will:

💾 Writing new config file: myst.yml
Migrating Jupyter Book configuration to myst.yml
Migrating TOC to myst.yml

Upgrade output

Step 4: Preview your book

When prompted, press Y to start the preview server:

? Would you like to run jupyter book start now? (Y/n)

This launches a local server where you can preview your upgraded book and verify everything works correctly.

Preview server running after upgrade

Figure 1:Preview server running after upgrade

Upgrade a Sphinx Site

To convert a Sphinx site to Jupyter Book, you need to replace {toctree} directives with a MyST Table of Contents.

Generate a starter TOC

cd book-folder
jupyter book init --write-toc

This creates a TOC based on your file structure.

Map your toctree structure

Re-order the generated TOC to match your {toctree} directives. For example:

Before (Sphinx):

```{toctree}
page1
page2
```

After (Jupyter Book):

toc:
- file: myfolder/index
  children:
  - file: myfolder/page1
  - file: myfolder/page2

Remove the {toctree} directives from your pages as you migrate them.

FAQ: Migration and Troubleshooting

See Migrating and troubleshooting upgrades.