Warning ⚠️
This project served it's purpose for rtCamp's own need. The project, by its nature, is not required anymore by rtCamp so it is not maintained anymore.
Your support requests and pull requests may get unanswered.
Requirements
PHP 7.1 or higher.
Setup
Download dependencies via composer
composer installCreate .env file
cp .env.sample .envUpdate .env with all details.
Note: Some endpoint requires admin/sudo token like getting snippets.
Run 🚀
php main.phpGet user mapping file
This creates user mapping of GitLab and GitHub username's for and updates it's reference in comments, description and assignee accordingly. The generated csv is used internally to update username references as mentioned above.
php main.php --user --create-mapped-csvTo migrate a repo
php main.php --migrate-repo --gitlab-group=test-github-import --gitlab-project-name=test-repo-1 --includes=all --force-assignee --github-name=test-repo-1 --yesTo migrate a group
php main.php --migrate-repo --gitlab-group=group-name --includes=all --use-repo-name-as-github-repo --yes--yes will not prompt for migrating each repo.
Archive repos by namespace or group
php main.php --archive --gitlab-group=test-github-importArchive a repo by project name
php main.php --archive --gitlab-group=test-github-import --gitlab-project-name=test-repo-1To delete a repo
php main.php --delete --path=./delete-repos.csv --yes| Namespace/Reponame |
|---|
| test-github-import/to-be-deleted-1 |
| test-github-import/to-be-deleted-2 |
To list repos with snippets
php main.php --get-snippet-infoMigrate all snippets in single repo.
Uses SNIPPET_REPO_GIT_URL in .env
Uses admin sudo endpoint to get all snippets from GitLab.
php main.php --migrate-snippetsTo add team to GitHub groups
php main.php --add-team --team=rtMedia --keyword=rtmediaList repo
php main.php --list-repo --export=csv/jsonGet gitlab statistics
Display in a table format on console
php stats.phpExport to CSV file
php stats.php > stats.csvNote
- By default all projects will be created with
privateaccess. To create a repo withpublicvisibility, pass--publicarg explicitly. - If you want to import all project of a group do no specify gitlab-project-name.
- You can add
--use-repo-name-as-github-repowhich will not rename project as{group-name}-{project-name}. --github-namename still takes priority on👆 if specified.
Open issues / Doesn't handle.
- Doesn't Migrate Images/Attachment right now, uses Gitlab Image/Attachment URL in comment/description.
- Doesn't migrate Wiki.
- Doesn't handle PR and it's comment well.
- Doesn't Handle mapping of external users and blocked users of GitLab.
- Project settings and collaborators. (Partially handles invites when adding issue assignee if they are part of organization)
API Warning ⚠️
This project uses GitHub's Preview API. It is undergoing changes so things might break anytime.
License 🎓
MIT
Contributors
Thanks goes to these wonderful people (emoji key):
Rahul Bansal |
Utkarsh Patel |
Thrijith Thankachan |
Vaishali |
Vishal Kakadiya |
|---|