Project import and export Rake tasks

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed

GitLab provides Rake tasks for project import and export.

You can only import from a compatible GitLab instance.

Import large projects

The Rake task is used for importing large GitLab project exports.

As part of this task, we also disable direct upload. This avoids uploading a huge archive to GCS, which can cause idle transaction timeouts.

We can run this task from the terminal:

Parameters:

AttributeTypeRequiredDescription
usernamestringyesUser name
namespace_pathstringyesNamespace path
project_pathstringyesProject path
archive_pathstringyesPath to the exported project tarball you want to import
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

Export large projects

You can use a Rake task to export large project.

Parameters:

AttributeTypeRequiredDescription
usernamestringyesUser name
namespace_pathstringyesNamespace path
project_pathstringyesProject name
archive_pathstringyesPath to file to store the export project tarball
gitlab-rake "gitlab:import_export:export[username, namespace_path, project_path, archive_path]"