数据导入
¥Data import
4.6.0This feature requires Strapi version 4.6.0 or later.strapi import 命令是 数据管理功能 的一部分,用于从文件导入数据。默认情况下,strapi import 命令从加密和压缩的 tar.gz.enc 文件导入数据,其中包括:
¥The strapi import command is part of the Data Management feature and used to import data from a file. By default, the strapi import command imports data from an encrypted and compressed tar.gz.enc file which includes:
-
项目配置,
¥the project configuration,
-
实体:你的所有内容,
¥entities: all of your content,
-
链接:你的实体之间的关系,
¥links: relations between your entities,
-
资源:文件存储在上传文件夹中,
¥assets: files stored in the uploads folder,
-
模式,
¥schemas,
-
metadata.json文件。¥the
metadata.jsonfile.
该存档遵循与 strapi export 生成的存档相同的结构:.tar 包含 configuration、entities、links 和 schemas 文件夹,其中包含按编号排列的 JSON 行 文件。压缩 (.gz) 和加密 (.enc) 会从文件扩展名中检测出来,因此也可以导入纯文本 .tar。
¥The archive follows the same structure as the one produced by strapi export: a .tar containing configuration, entities, links, and schemas folders filled with numbered JSON lines files. Compression (.gz) and encryption (.enc) are detected from the file extension, so a plain .tar can be imported as well.