Skip to main content

v4 代码迁移指南

¥v4 code migration guide

Strapi v4 引入了重大更改,需要手动更新现有 Strapi 项目的代码库。

¥Strapi v4 introduces breaking changes that require manually updating the codebase of an existing Strapi project.

本指南涵盖将 Strapi v3.6.x 应用的 后端前端 迁移到 Strapi v4.0.x。并围绕小的独立主题构建。

¥This guide covers migrating both the backend and the frontend of a Strapi v3.6.x application to Strapi v4.0.x. and is built around small independent topics.

☑️ Prerequisites

迁移 Strapi 应用的后端代码是迁移前端的先决条件。

¥Migrating the backend code of a Strapi application is a prerequisite to migrating the frontend.

对于涵盖的每个主题,本指南旨在:

¥For each topic covered, this guide is designed to:

  • 帮助你了解 Strapi v3 和 v4 之间的主要区别,

    ¥help you understand the main differences between Strapi v3 and v4,

  • 通过将内置代码迁移到 Strapi v4 来帮助你解决重大变更,

    ¥help you resolve breaking changes by migrating built-in code to Strapi v4,

  • 并且,只要有可能,就如何迁移自定义代码提供一些线索和起点。

    ¥and, whenever possible, offer some clues and starting points on how to migrate custom code.

本指南涵盖以下主题,你可以单击特定主题跳转到专用迁移文档,或单击范围以阅读后端或前端迁移的更一般性介绍:

¥The following topics are covered by this guide, and you can either click on a specific topic to jump to the dedicated migration documentation or click on a scope to read a more general introduction for the backend or the frontend migration:

范围话题
后端代码迁移
前端代码迁移
✏️ 注意

本代码迁移指南并未广泛涵盖以下主题,但 Strapi v4 还介绍了:

¥The following topics are not extensively covered in this code migration guide, but Strapi v4 also introduces:

🤓 需要更多帮助吗?

请随时在 论坛 或社区 Discord 上寻求帮助。

¥Feel free to ask for help on the forum or on the community Discord.