Name | g2g JSON |
Version |
0.1.4
JSON |
| download |
home_page | |
Summary | Easy migration between GitLab instances for specific group with it's repositories and subgroups. |
upload_time | 2023-11-11 13:42:16 |
maintainer | |
docs_url | None |
author | Lucian BLETAN |
requires_python | >=3.8,<4.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# g2g: GitLab to GitLab Group Migrator
`g2g` is a Python CLI utility designed to streamline the process of migrating groups, and subgroups from one GitLab instance to another.
## Features
- Migrate entire group with his nested subgroups/repositories.
- Works with private and public repositories.
- Handles existing groups and repositories elegantly.
- Generate a JSON backup of Group metadata.
- Token-based authentication for security.
## Installation
You can install the package from PyPI:
```bash
pip install g2g
```
## Usage
### Basic usage:
The primary commands for `g2g` are `download` and `upload`.
```bash
g2g download --api-url "https://gitlab.com/api/v4" --group "mloops" --clean-all
Please enter your GitLab Private Token:
Removing existing group directory: mloops
Cloning devops-within...
Cloning devops-brother...
Downloading subgroup devops-card
Cloning devops-Mr...
Downloading subgroup devops-animal
Cloning devops-life...
Downloading subgroup devops-home
Cloning devops-free...
Downloading subgroup devops-recently
Cloning devops-leave...
Cloning devops-trouble...
Downloading subgroup devops-time
Cloning devops-while...
Downloading subgroup devops-girl
Cloning devops-hotel...
```
```bash
g2g upload --api-url https://new.instance.localhost/api/v4 --group mloops
Please enter your GitLab Private Token for the new instance:
{
"devops-brother": {
"path": "mloops/devops-brother"
},
"devops-trouble": {
"path": "mloops/devops-home/devops-recently/devops-trouble"
},
"devops-leave": {
"path": "mloops/devops-home/devops-recently/devops-leave"
},
"devops-free": {
"path": "mloops/devops-home/devops-free"
},
"devops-while": {
"path": "mloops/devops-time/devops-while"
},
"devops-hotel": {
"path": "mloops/devops-time/devops-girl/devops-hotel"
},
"devops-within": {
"path": "mloops/devops-within"
},
"devops-life": {
"path": "mloops/devops-card/devops-animal/devops-life"
},
"devops-Mr": {
"path": "mloops/devops-card/devops-Mr"
}
}
Processing devops-brother with path parts: ['mloops', 'devops-brother']
Group specified. Updated path parts: ['mloops', 'devops-brother']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating new project: devops-brother under parent ID: 3283
Successfully created and pushed to https://new.instance.localhost/mloops/devops-brother.git
Processing devops-trouble with path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-trouble']
Group specified. Updated path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-trouble']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-home
Group devops-home created or fetched with ID: 3285
Creating or getting group: devops-recently
Group devops-recently created or fetched with ID: 3286
Creating new project: devops-trouble under parent ID: 3286
Successfully created and pushed to https://new.instance.localhost/mloops/devops-home/devops-recently/devops-trouble.git
Processing devops-leave with path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-leave']
Group specified. Updated path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-leave']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-home
Group devops-home created or fetched with ID: 3285
Creating or getting group: devops-recently
Group devops-recently created or fetched with ID: 3286
Creating new project: devops-leave under parent ID: 3286
Successfully created and pushed to https://new.instance.localhost/mloops/devops-home/devops-recently/devops-leave.git
Processing devops-free with path parts: ['mloops', 'devops-home', 'devops-free']
Group specified. Updated path parts: ['mloops', 'devops-home', 'devops-free']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-home
Group devops-home created or fetched with ID: 3285
Creating new project: devops-free under parent ID: 3285
Successfully created and pushed to https://new.instance.localhost/mloops/devops-home/devops-free.git
Processing devops-while with path parts: ['mloops', 'devops-time', 'devops-while']
Group specified. Updated path parts: ['mloops', 'devops-time', 'devops-while']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-time
Group devops-time created or fetched with ID: 3290
Creating new project: devops-while under parent ID: 3290
Successfully created and pushed to https://new.instance.localhost/mloops/devops-time/devops-while.git
Processing devops-hotel with path parts: ['mloops', 'devops-time', 'devops-girl', 'devops-hotel']
Group specified. Updated path parts: ['mloops', 'devops-time', 'devops-girl', 'devops-hotel']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-time
Group devops-time created or fetched with ID: 3290
Creating or getting group: devops-girl
Group devops-girl created or fetched with ID: 3292
Creating new project: devops-hotel under parent ID: 3292
Successfully created and pushed to https://new.instance.localhost/mloops/devops-time/devops-girl/devops-hotel.git
Processing devops-within with path parts: ['mloops', 'devops-within']
Group specified. Updated path parts: ['mloops', 'devops-within']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating new project: devops-within under parent ID: 3283
Successfully created and pushed to https://new.instance.localhost/mloops/devops-within.git
Processing devops-life with path parts: ['mloops', 'devops-card', 'devops-animal', 'devops-life']
Group specified. Updated path parts: ['mloops', 'devops-card', 'devops-animal', 'devops-life']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-card
Group devops-card created or fetched with ID: 3295
Creating or getting group: devops-animal
Group devops-animal created or fetched with ID: 3296
Creating new project: devops-life under parent ID: 3296
Successfully created and pushed to https://new.instance.localhost/mloops/devops-card/devops-animal/devops-life.git
Processing devops-Mr with path parts: ['mloops', 'devops-card', 'devops-Mr']
Group specified. Updated path parts: ['mloops', 'devops-card', 'devops-Mr']
Creating or getting group: mloops
Group mloops created or fetched with ID: 3283
Creating or getting group: devops-card
Group devops-card created or fetched with ID: 3295
Creating new project: devops-Mr under parent ID: 3295
Successfully created and pushed to https://new.instance.localhost/mloops/devops-card/devops-Mr.git
```
### Additional Options:
- `--token TEXT` The GitLab Private Token for CI/CD
- `--output-file` to specify the JSON file for saving repo information.
- `--input-file` to specify the JSON file for reading repo information.
- `--clean-all` to remove all existing repos before download.
## Contributing
All contributions are welcome! Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
MIT Licensed. See [LICENSE](LICENSE) for full details.
## Author
- [Lucian BLETAN](https://github.com/exaluc)
Raw data
{
"_id": null,
"home_page": "",
"name": "g2g",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Lucian BLETAN",
"author_email": "exaluc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ed/59/9797eca588582be215d9ca758ffd39643050eb0ee43d42ecd14b1e12357a/g2g-0.1.4.tar.gz",
"platform": null,
"description": "# g2g: GitLab to GitLab Group Migrator\n\n`g2g` is a Python CLI utility designed to streamline the process of migrating groups, and subgroups from one GitLab instance to another.\n\n## Features\n\n- Migrate entire group with his nested subgroups/repositories.\n- Works with private and public repositories.\n- Handles existing groups and repositories elegantly.\n- Generate a JSON backup of Group metadata.\n- Token-based authentication for security.\n\n## Installation\n\nYou can install the package from PyPI:\n\n```bash\npip install g2g\n```\n\n## Usage\n\n### Basic usage:\n\nThe primary commands for `g2g` are `download` and `upload`.\n\n```bash\ng2g download --api-url \"https://gitlab.com/api/v4\" --group \"mloops\" --clean-all\nPlease enter your GitLab Private Token: \nRemoving existing group directory: mloops\nCloning devops-within...\nCloning devops-brother...\nDownloading subgroup devops-card\nCloning devops-Mr...\nDownloading subgroup devops-animal\nCloning devops-life...\nDownloading subgroup devops-home\nCloning devops-free...\nDownloading subgroup devops-recently\nCloning devops-leave...\nCloning devops-trouble...\nDownloading subgroup devops-time\nCloning devops-while...\nDownloading subgroup devops-girl\nCloning devops-hotel...\n```\n\n```bash\ng2g upload --api-url https://new.instance.localhost/api/v4 --group mloops\nPlease enter your GitLab Private Token for the new instance: \n{\n \"devops-brother\": {\n \"path\": \"mloops/devops-brother\"\n },\n \"devops-trouble\": {\n \"path\": \"mloops/devops-home/devops-recently/devops-trouble\"\n },\n \"devops-leave\": {\n \"path\": \"mloops/devops-home/devops-recently/devops-leave\"\n },\n \"devops-free\": {\n \"path\": \"mloops/devops-home/devops-free\"\n },\n \"devops-while\": {\n \"path\": \"mloops/devops-time/devops-while\"\n },\n \"devops-hotel\": {\n \"path\": \"mloops/devops-time/devops-girl/devops-hotel\"\n },\n \"devops-within\": {\n \"path\": \"mloops/devops-within\"\n },\n \"devops-life\": {\n \"path\": \"mloops/devops-card/devops-animal/devops-life\"\n },\n \"devops-Mr\": {\n \"path\": \"mloops/devops-card/devops-Mr\"\n }\n}\nProcessing devops-brother with path parts: ['mloops', 'devops-brother']\nGroup specified. Updated path parts: ['mloops', 'devops-brother']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating new project: devops-brother under parent ID: 3283\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-brother.git\nProcessing devops-trouble with path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-trouble']\nGroup specified. Updated path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-trouble']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-home\nGroup devops-home created or fetched with ID: 3285\nCreating or getting group: devops-recently\nGroup devops-recently created or fetched with ID: 3286\nCreating new project: devops-trouble under parent ID: 3286\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-home/devops-recently/devops-trouble.git\nProcessing devops-leave with path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-leave']\nGroup specified. Updated path parts: ['mloops', 'devops-home', 'devops-recently', 'devops-leave']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-home\nGroup devops-home created or fetched with ID: 3285\nCreating or getting group: devops-recently\nGroup devops-recently created or fetched with ID: 3286\nCreating new project: devops-leave under parent ID: 3286\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-home/devops-recently/devops-leave.git\nProcessing devops-free with path parts: ['mloops', 'devops-home', 'devops-free']\nGroup specified. Updated path parts: ['mloops', 'devops-home', 'devops-free']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-home\nGroup devops-home created or fetched with ID: 3285\nCreating new project: devops-free under parent ID: 3285\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-home/devops-free.git\nProcessing devops-while with path parts: ['mloops', 'devops-time', 'devops-while']\nGroup specified. Updated path parts: ['mloops', 'devops-time', 'devops-while']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-time\nGroup devops-time created or fetched with ID: 3290\nCreating new project: devops-while under parent ID: 3290\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-time/devops-while.git\nProcessing devops-hotel with path parts: ['mloops', 'devops-time', 'devops-girl', 'devops-hotel']\nGroup specified. Updated path parts: ['mloops', 'devops-time', 'devops-girl', 'devops-hotel']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-time\nGroup devops-time created or fetched with ID: 3290\nCreating or getting group: devops-girl\nGroup devops-girl created or fetched with ID: 3292\nCreating new project: devops-hotel under parent ID: 3292\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-time/devops-girl/devops-hotel.git\nProcessing devops-within with path parts: ['mloops', 'devops-within']\nGroup specified. Updated path parts: ['mloops', 'devops-within']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating new project: devops-within under parent ID: 3283\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-within.git\nProcessing devops-life with path parts: ['mloops', 'devops-card', 'devops-animal', 'devops-life']\nGroup specified. Updated path parts: ['mloops', 'devops-card', 'devops-animal', 'devops-life']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-card\nGroup devops-card created or fetched with ID: 3295\nCreating or getting group: devops-animal\nGroup devops-animal created or fetched with ID: 3296\nCreating new project: devops-life under parent ID: 3296\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-card/devops-animal/devops-life.git\nProcessing devops-Mr with path parts: ['mloops', 'devops-card', 'devops-Mr']\nGroup specified. Updated path parts: ['mloops', 'devops-card', 'devops-Mr']\nCreating or getting group: mloops\nGroup mloops created or fetched with ID: 3283\nCreating or getting group: devops-card\nGroup devops-card created or fetched with ID: 3295\nCreating new project: devops-Mr under parent ID: 3295\nSuccessfully created and pushed to https://new.instance.localhost/mloops/devops-card/devops-Mr.git\n```\n\n### Additional Options:\n\n- `--token TEXT` The GitLab Private Token for CI/CD\n- `--output-file` to specify the JSON file for saving repo information.\n- `--input-file` to specify the JSON file for reading repo information.\n- `--clean-all` to remove all existing repos before download.\n\n## Contributing\n\nAll contributions are welcome! Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nMIT Licensed. See [LICENSE](LICENSE) for full details.\n\n## Author\n\n- [Lucian BLETAN](https://github.com/exaluc)",
"bugtrack_url": null,
"license": "MIT",
"summary": "Easy migration between GitLab instances for specific group with it's repositories and subgroups.",
"version": "0.1.4",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "940932216dbc7172b6dc99fed4a5fdc667222948fb87dae0e5baa75f66e5a4ca",
"md5": "8bf3aca079849d07629b047ad1abe9a7",
"sha256": "b50533f18cfe5a33dd19bdb5b468a56c03a4590b49407a8a7878a620903f819b"
},
"downloads": -1,
"filename": "g2g-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8bf3aca079849d07629b047ad1abe9a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 6998,
"upload_time": "2023-11-11T13:42:14",
"upload_time_iso_8601": "2023-11-11T13:42:14.908008Z",
"url": "https://files.pythonhosted.org/packages/94/09/32216dbc7172b6dc99fed4a5fdc667222948fb87dae0e5baa75f66e5a4ca/g2g-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ed599797eca588582be215d9ca758ffd39643050eb0ee43d42ecd14b1e12357a",
"md5": "2187a7ebea5e782f3bdcee68a15df896",
"sha256": "4937940b4f26f0abd10ad8a8458ed1cad6e2a433a8cfa30b7869b869c7a100f2"
},
"downloads": -1,
"filename": "g2g-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "2187a7ebea5e782f3bdcee68a15df896",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 6067,
"upload_time": "2023-11-11T13:42:16",
"upload_time_iso_8601": "2023-11-11T13:42:16.968114Z",
"url": "https://files.pythonhosted.org/packages/ed/59/9797eca588582be215d9ca758ffd39643050eb0ee43d42ecd14b1e12357a/g2g-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-11 13:42:16",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "g2g"
}