Overview
This doc guides you through migrating an existing Docusaurus 1 site to Docusaurus 2.
We try to make this as easy as possible, and provide a migration CLI.
Main differences
Section titled βMain differencesβDocusaurus 1 is a pure documentation site generator, using React as a server-side template engine, but not loading React on the browser.
Docusaurus 2, rebuilt from the ground up, generates a single-page-application, using the full power of React in the browser. It allows for more customizability but preserved the best parts of Docusaurus 1 - easy to get started, versioned docs, and i18n.
Beyond that, Docusaurus 2 is a performant static site generator and can be used to create common content-driven websites (e.g. Documentation, Blogs, Product Landing and Marketing Pages, etc) extremely quickly.
While our main focus will still be helping you get your documentations right and well, it is possible to build any kind of website using Docusaurus 2 as it is just a React application. Docusaurus can now be used to build any website, not just documentation websites.
Docusaurus 1 structure
Section titled βDocusaurus 1 structureβYour Docusaurus 1 site should have the following structure:
βββ docs
βββ website
βββ blog
βββ core
β βββ Footer.js
βββ package.json
βββ pages
βββ sidebars.json
βββ siteConfig.js
βββ staticDocusaurus 2 structure
Section titled βDocusaurus 2 structureβAfter the migration, your Docusaurus 2 site could look like:
βββ docs
βββ website
βββ blog
βββ src
β βββ components
β βββ css
β βββ pages
βββ static
βββ package.json
βββ sidebars.json
βββ docusaurus.config.jsMigration process
Section titled βMigration processβThere are multiple things to migrate to obtain a fully functional Docusaurus 2 website:
- packages
- CLI commands
- site configuration
- Markdown files
- sidebars file
- pages, components and CSS
- versioned docs
- i18n support π§
Automated migration process
Section titled βAutomated migration processβThe migration CLI will handle many things of the migration for you.
However, some parts can't easily be automated, and you will have to fallback to the manual process.
Manual migration process
Section titled βManual migration processβSome parts of the migration can't be automated (particularly the pages), and you will have to migrate them manually.
The manual migration guide will give you all the manual steps.
Support
Section titled βSupportβFor any questions, you can ask in the #migration-v1-to-v2 Discord channel.
Feel free to tag @slorber in any migration PRs if you would like us to have a look.
We also have volunteers willing to help you migrate your v1 site.
Example migration PRs
Section titled βExample migration PRsβYou might want to refer to our migration PRs for Create React App and Flux as examples of how a migration for a basic Docusaurus v1 site can be done.