Automated migration
The migration CLI automatically migrates your v1 website to a v2 website.
信息
Manual work is still required after using the migration CLI, as we can't automate a full migration
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 structure shown at the start of this page. -
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.
- npm
- Yarn
- pnpm
cd ./v2-website
npm install
npm start
cd ./v2-website
yarn install
yarn start