Skip to content

Migrating to GitHub Enterprise Cloud

Help

Have you used any of these guides? How did it go? Please provide feedback to help us improve them for everyone!

Migrate from github.tamu.edu

GitHub repositories - whether on github.com or github.tamu.edu - are more than just a git repo: they all have a git repository core and a potentially large amount of other data like metadata and artifacts associated with that repository. The git repo is the code, the commits, history, branches, and tags, while the other data are the issues, pull requests, releases - anything not normally in git.

If all you need is to move the git repository from github.tamu.edu to github.com, follow our much simpler Migrate from another source guide.

If you need to bring over any of the other data, for now, there is only one option: github-migration.

Note

GitHub Enterprise Importer is a project we are investigating to use in an AIP-provided migration tool but, today, cannot be used directly as a self-service option.

Using github-migration

Warning

There are a few things about this tool that are very important to bring up right away:

  • It will not migrate any attachments in issues and pull requests. If you have access to an S3 bucket, you can use the optional S3 script. Otherwise, attachments, like images, logs, or trace files, will not be included in issue comments.
  • In most cases, the user performing the migration will become the actor on all issue/pull request comments and history, and the date of the action will be the migration date; however, the original actor and date are preserved in the comment body.
  • It will not migrate repository settings, collaborators, teams, webhooks, LFS content, or wikis.
  • It will not create new repositories on github.com.
  • It requires decent comfort configuring and running command-line tools and scripts and obtaining API tokens.

To install github-migration:

  1. Make sure you have nodejs installed on your system.
  2. Clone github-migration
    git clone https://github.com/NicholasBoll/github-migration && cd github-migration
    
  3. Install program dependencies and initialize.
    npm install
    npm run initialize
    

Next, obtain access tokens to github.tamu.edu and github.com, if you do not have them already:

  1. For github.com, visit Personal access tokens to create a new token. Scopes required are: repo, read:org, and admin:repo_hook. Save this token for use later.
  2. For github.tamu.edu, visit Personal access tokens to create a new token. Scopes required are: repo, read:org, and admin:repo_hook. Save this token for use later.

Open config.js in your preferred editor and edit the following values:

  • .source.baseUrl: https://github.tamu.edu/repos
  • .source.org: The name of your organization, taken from https://github.tamu.edu/{source_org}/{source_repo}
  • .source.repo: The name of your repo, taken from https://github.tamu.edu/{source_org}/{source_repo}
  • .source.token: The token value created earlier for github.tamu.edu
  • .target.org: Either of tamu-edu or tamu-edu-students. https://github.com/{target_org}/{target_repo}
  • .target.repo: The name of your new, empty repo. https://github.com/{target_org}/{target_repo}. Take a moment to create this repo now if you haven't yet - this tool won't create it for you.
  • .target.token: The token value created earlier for github.com

Perform the migration steps:

  1. Test connectivity to the source and target with npm run test:source and npm run test:target.
  2. Clone your source repo. The mirror option will download all branches, tags and refs.
    git clone https://github.tamu.edu/{source_org}/{source_repo}.git --mirror
    
  3. Fetch the github other stuff. This step may take a while for large repos because of API rate limits.
    npm run fetch
    
  4. Temporarily convert some hidden data so it will push to github.com
    npm run rewriteRefs
    
  5. Push your git repo to the target
    cd {source_repo}.git
    git push https://github.com/{target_org}/{target_repo} --mirror
    
  6. Create the branches, issues, and pull requests on target:
    npm run createBranches
    npm run createIssues
    npm run createComments
    npm run updateIssues
    npm run deleteBranches
    npm run createReleases
    

If everything goes well, your new repo should be at https://github.com/{target_org}/{target_repo}. Look it over carefully. If there are any issues, contact us, and we will try to help you figure out what went wrong.

If your repository has a wiki, it can be migrated similar to:

git clone https://github.tamu.edu/{source_org}/{source_repo}.wiki.git 
cd {source_repo}.wiki.git 
git push https://github.com/{target_org}/{target_repo}.wiki.git

If your repository has LFS content, it can be transferred similar to:

git lfs fetch --all
git lfs push origin --all

Replace origin with the actual name of the github.com remote, if different.

Finally, go through your repository settings to ensure they are as intended, and add your collaborators either directly to the repo or through a Team.

Migrate from another github.com repository

  • follow instructions to enable your github.com account on the tamu-edu or tamu-edu-students organization
  • change name of existing, source repository to fit the new naming guidelines
  • navigate to repository on github.com and click settings tab
  • scroll to the bottom of the page and click Transfer inside the Danger Zone
  • type tamu-edu (or tamu-edu-students) for the destination organization
  • type in the existing repository name at the bottom
  • click I understand, transfer this repository

Migrate from another source

You can use the Adding locally hosted code to GitHub guide if you already have a git repository on your local system.

If you host your code on another git platform (such as BitBucket), try the GitHub Importer tool. You can also use the GitHub importer tool to import SVN and mercurial repositories.

Back to top