项目导入导出 Rake 任务

极狐GitLab 提供项目导入和导出 Rake 任务。

您可以仅从兼容的极狐GitLab 实例导入项目。

导入大型项目

Rake 任务用来导入大型的极狐GitLab 项目导出。

作为此任务的一部分,我们还禁用了直接上传。这能够避免上传巨大的归档(指项目)到 GCS,这可能导致空闲事务超时。

我们可以从命令行来运行此任务:

参数:

属性 类型 是否必需 描述
username string yes 用户名
namespace_path string yes 命名空间路径
project_path string yes 项目路径
archive_path string yes 您想导入的已导出项目的 tar 包路径

::Tabs

:::TabTitle Linux package (Omnibus)

gitlab-rake "gitlab:import_export:import[root, group/subgroup, testingprojectimport, /path/to/file.tar.gz]"

:::TabTitle Self-compiled (source)

bundle exec rake "gitlab:import_export:import[root, group/subgroup, testingprojectimport, /path/to/file.tar.gz]" RAILS_ENV=production

::EndTabs

导出大型项目

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

Parameters:

Attribute Type Required Description
username string yes 用户名
namespace_path string yes 命名空间路径
project_path string yes 项目路径
archive_path string yes 存储导出项目 tar 包的路径
gitlab-rake "gitlab:import_export:export[username, namespace_path, project_path, archive_path]"