Back to Gitlabhq

Tâches Rake d'import et d'export de projets

doc-locale/fr-fr/administration/raketasks/project_import_export.md

19.3.02.3 KB
Original Source

{{< details >}}

  • Niveau : Free, Premium, Ultimate
  • Offre : GitLab Self-Managed

{{< /details >}}

GitLab fournit des tâches Rake pour l'import et l'export de projets.

Vous ne pouvez importer qu'à partir d'une instance GitLab compatible.

Importer des projets volumineux {#import-large-projects}

La tâche Rake est utilisée pour importer des exports de projets GitLab volumineux.

Dans le cadre de cette tâche, nous désactivons également le téléversement direct. Cela évite de téléverser une archive volumineuse vers GCS, ce qui peut entraîner des délais d'expiration de transaction inactive.

Nous pouvons exécuter cette tâche depuis le terminal :

Paramètres :

AttributTypeObligatoireDescription
usernamestringouiNom d'utilisateur
namespace_pathstringouiChemin de l'espace de nommage
project_pathstringouiChemin du projet
archive_pathstringouiChemin vers le tarball du projet exporté que vous souhaitez importer

{{< tabs >}}

{{< tab title="Paquet Linux (Omnibus)" >}}

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

{{< /tab >}}

{{< tab title="Auto-compilée (source)" >}}

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

{{< /tab >}}

{{< /tabs >}}

Exporter des projets volumineux {#export-large-projects}

Vous pouvez utiliser une tâche Rake pour exporter un projet volumineux.

Paramètres :

AttributTypeObligatoireDescription
usernamestringouiNom d'utilisateur
namespace_pathstringouiChemin de l'espace de nommage
project_pathstringouiNom du projet
archive_pathstringouiChemin vers le fichier pour stocker le tarball du projet exporté
shell
gitlab-rake "gitlab:import_export:export[username, namespace_path, project_path, archive_path]"