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
:
- Make sure you have nodejs installed on your system.
- Clone
github-migration
- Install program dependencies and initialize.
Next, obtain access tokens to github.tamu.edu
and github.com
, if you do not have them already:
- For
github.com
, visit Personal access tokens to create a new token. Scopes required are:repo
,read:org
, andadmin:repo_hook
. Save this token for use later. - For
github.tamu.edu
, visit Personal access tokens to create a new token. Scopes required are:repo
,read:org
, andadmin: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 forgithub.tamu.edu
.target.org
: Either oftamu-edu
ortamu-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 forgithub.com
Perform the migration steps:
- Test connectivity to the source and target with
npm run test:source
andnpm run test:target
. - Clone your source repo. The mirror option will download all branches, tags and refs.
- Fetch the github other stuff. This step may take a while for large repos because of API rate limits.
- Temporarily convert some hidden data so it will push to
github.com
- Push your git repo to the target
- Create the branches, issues, and pull requests on target:
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:
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 thetamu-edu
ortamu-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 theDanger Zone
- type
tamu-edu
(ortamu-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.