Migrate GitLab projects from a GitLab group to another GitLab's group
Project description
gitlab-projects-migrate
Migrate GitLab projects from a GitLab group to another GitLab's group
Purpose
The migration can be performed between entirely different GitLab servers.
The following steps are required before using the tool:
- The groups need to be created manually by the user or by a GitLab administrator
- The GitLab user tokens must be created with an
api
scope (a short expiration date is recommended)
Examples
# Show the helper menu
gitlab-projects-migrate
# Migrate projects from one group to another, then migrate subgroups
gitlab-projects-migrate 'https://gitlab.com' 'old/group' 'https://gitlab.com' 'new/group'
gitlab-projects-migrate 'https://gitlab.com' 'old/group/subgroup1' 'https://gitlab.com' 'new/group/subgroup1'
gitlab-projects-migrate 'https://gitlab.com' 'old/group/subgroup2' 'https://gitlab.com' 'new/group/subgroup2'
# Migrate projects from one GitLab to another GitLab
gitlab-projects-migrate 'https://old.gitlab.com' 'group/subgroup' 'https://new.gitlab.com'
Usage
usage: gitlab-projects-migrate [-h] [--version] [-I INPUT_TOKEN] [-O OUTPUT_TOKEN] [--dry-run] [--exclude-group]
[--exclude-subgroups] [--exclude-projects] [--keep-members] [--overwrite]
[--set-avatar FILE] [--update-description]
[input_gitlab] [input_path] [output_gitlab] [output_group]
gitlab-projects-migrate: Migrate GitLab projects from a GitLab group to another GitLab's group
internal arguments:
-h, --help # Show this help message
--version # Show the current version
credentials arguments:
-I INPUT_TOKEN # Input GitLab API token (default: GITLAB_INPUT_TOKEN or GITLAB_TOKEN environments)
-O OUTPUT_TOKEN # Output GitLab API token (default: GITLAB_OUTPUT_TOKEN, GITLAB_TOKEN environments, or INPUT_TOKEN argument)
migration arguments:
--dry-run # Enable dry run mode to check without saving
--exclude-group # Exclude parent group migration
--exclude-subgroups # Exclude children subgroups migration
--exclude-projects # Exclude children projects migration
--keep-members # Keep input members after importing on output GitLab
--overwrite # Overwrite existing projects on output GitLab
general settings arguments:
--set-avatar FILE # Set avatar of GitLab output projects and groups
--update-description # Update description of GitLab output projects and groups automatically
positional arguments:
input_gitlab # Input GitLab URL (default: https://gitlab.com)
input_path # Input GitLab group or project path
output_gitlab # Output GitLab URL (default: https://gitlab.com)
output_group # Output GitLab group
Dependencies
- colored: Terminal colors and styles
- python-gitlab: A python wrapper for the GitLab API
- setuptools: Build and manage Python packages
References
- git-chglog: CHANGELOG generator
- gitlab-release: Utility for publishing on GitLab
- gitlabci-local: Launch .gitlab-ci.yml jobs locally
- mypy: Optional static typing for Python
- PyPI: The Python Package Index
- twine: Utility for publishing on PyPI
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for gitlab_projects_migrate-2.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9d574b72e81667701724183c08bd00a9c71f423ae0af68123d70b503334848b |
|
MD5 | 2c82055e59b692578302ec74c5766ac7 |
|
BLAKE2b-256 | 4fe2922fdbfda74dfa232eb6e7d242979d5e2653403306c982518076d46ed43a |
Close
Hashes for gitlab_projects_migrate-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d87332774ba15c0c86e36a7384158cc11bbd992dd691c922e943a6f71a496226 |
|
MD5 | 8520e9ce1cc24b0aeaf9b822b6b461b6 |
|
BLAKE2b-256 | 1079a7989070a366fcb8421c743979475e38825580b3d25fd0468acb647b74cd |