Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

rtCamp/gitlab-to-github-migration

Repository files navigation

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.

☠️ Use at your own risk. ☠️

Requirements

PHP 7.1 or higher.

Setup

Download dependencies via composer

composer install

Create .env file

cp .env.sample .env

Update .env with all details.

Note: Some endpoint requires admin/sudo token like getting snippets.

Run 🚀

php main.php
Get 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-csv
To 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 --yes
To 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-import
Archive a repo by project name
php main.php --archive --gitlab-group=test-github-import --gitlab-project-name=test-repo-1
To 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-info
Migrate 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-snippets

To add team to GitHub groups

php main.php --add-team --team=rtMedia --keyword=rtmedia

List repo

php main.php --list-repo --export=csv/json

Get gitlab statistics

Display in a table format on console

php stats.php

Export to CSV file

php stats.php > stats.csv

Note

  • By default all projects will be created with private access. To create a repo with public visibility, pass --public arg 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-repo which will not rename project as {group-name}-{project-name}.
  • --github-name name 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
Rahul Bansal

🤔 📖 💻
Utkarsh Patel
Utkarsh Patel

🤔 💻 📖 👀
Thrijith Thankachan
Thrijith Thankachan

💻 📖
Vaishali
Vaishali

💻 📖
Vishal Kakadiya
Vishal Kakadiya

💻 📖

Releases

No releases published

Packages

No packages published

Languages