Automated migration
The migration CLI automatically migrates your v1 website to a v2 website.
The migration CLI migrates:
- Site configurations (from
siteConfig.jstodocusaurus.config.js) package.jsonsidebars.json/docs/blog/staticversioned_sidebar.jsonand/versioned_docsif your site uses versioning
To use the migration CLI, follow these steps:
-
Before using the migration CLI, ensure that
/docs,/blog,/static,sidebars.json,siteConfig.js,package.jsonfollow the expected structure. -
To migrate your v1 website, run the migration CLI with the appropriate filesystem paths:
# migration command format
npx @docusaurus/migrate migrate <v1 website directory> <desired v2 website directory>
# example
npx @docusaurus/migrate migrate ./v1-website ./v2-website- To view your new website locally, go into your v2 website's directory and start your development server.
cd ./v2-website
npm install
npm startOptions
Section titled βOptionsβYou can add option flags to the migration CLI to automatically migrate Markdown content and pages to v2. It is likely that you will still need to make some manual changes to achieve your desired result.
| Name | Description |
|---|---|
--mdx |
Add this flag to convert Markdown to MDX automatically |
--page |
Add this flag to migrate pages automatically |
# example using options
npx @docusaurus/migrate migrate --mdx --page ./v1-website ./v2-website