Skip to main content

数据迁移指南

¥Data migration guide

本指南的目标是介绍如何将数据从 Strapi v3 迁移到 Strapi v4

¥The goal of this guide is to cover how data can be migrated from Strapi v3 to Strapi v4.

Strapi v4 在数据库层引入了重大更改,需要手动迁移数据。目前数据迁移应手动完成,但很快就会提供脚本来帮助自动化某些迁移步骤。

¥Strapi v4 introduced breaking changes in the database layer which require manually migrating the data. The data migration should be done manually for now, but scripts will be available soon to help automate some of the migration steps.

Strapi v4支持 SQL 数据库 并且不支持 MongoDB 数据库(参见 博客文章公告)。

¥Strapi v4 only supports SQL databases and does not support MongoDB databases (see blog post announcement).

要将 SQL 数据库从 Strapi v3 迁移到 Strapi v4,请参阅 数据迁移指南的 SQL 部分

¥To migrate a SQL database from Strapi v3 to Strapi v4, please refer to the SQL section of the data migration guide.

将带有 MongoDB 数据库的 Strapi v3 项目迁移到 Strapi v4 的过程分为两步:

¥Migrating a Strapi v3 project with a MongoDB database to Strapi v4 is a 2-step process:

  1. 使用 Strapi v3 从 MongoDB 迁移到 SQL(请参阅 MongoDB 迁移),

    ¥Migrate from MongoDB to SQL with Strapi v3 (see MongoDB migration),

  2. 将 SQL 数据库从 Strapi v3 迁移到 Strapi v4(请参阅 SQL 迁移)。

    ¥Migrate the SQL database from Strapi v3 to Strapi v4 (see SQL migration).

⚠️ 🚧 迁移脚本

数据迁移脚本 目前正在测试中。请随时在 专门的论坛主题 中分享反馈。

¥Data migration scripts are currently under testing. Please feel free to share feedback in the dedicated forum thread.