Help us learn about your current experience with the documentation. Take the survey.

项目导入和导出 Rake 任务

  • 版本:Free, Premium, Ultimate
  • 产品:GitLab Self-Managed

GitLab 为项目导入和导出提供了 Rake 任务。

您只能从兼容的 GitLab 实例导入。

导入大型项目

Rake 任务用于导入大型的 GitLab 项目导出文件。

作为此任务的一部分,我们也会禁用直接上传。这避免了将巨大的归档文件上传到 GCS,从而防止空闲事务超时。

我们可以从终端运行此任务:

参数:

属性 类型 必需 描述
username string yes 用户名
namespace_path string yes 命名空间路径
project_path string yes 项目路径
archive_path string yes 您想要导入的项目导出 tarball 文件的路径
gitlab-rake "gitlab:import_export:import[root, group/subgroup, testingprojectimport, /path/to/file.tar.gz]"
bundle exec rake "gitlab:import_export:import[root, group/subgroup, testingprojectimport, /path/to/file.tar.gz]" RAILS_ENV=production

导出大型项目

您可以使用 Rake 任务来导出大型项目。

参数:

属性 类型 必需 描述
username string yes 用户名
namespace_path string yes 命名空间路径
project_path string yes 项目名称
archive_path string yes 用于存储导出项目 tarball 的文件路径
gitlab-rake "gitlab:import_export:export[username, namespace_path, project_path, archive_path]"