Skip to content

Instantly share code, notes, and snippets.

@robandpdx
Last active September 14, 2022 14:38
Show Gist options
  • Save robandpdx/a151380a8a8596410c2ed87fadcf9ea0 to your computer and use it in GitHub Desktop.
Save robandpdx/a151380a8a8596410c2ed87fadcf9ea0 to your computer and use it in GitHub Desktop.
Migration instructions

Documentation

GitHub CLI
GitHub Enterprise Importer CLI
GitHub Enterprise Importer (GEI)
GEI limitations

The following is a check-list for steps to take, before and after migrations.
Before Migration
Organization / Users:

  • EMU organizations created (named differently than source organizations)
  • Create Personal Access Tokens with repo, admin:org, and workflow scopes for both GHEC and GHEC-EMU organizations.
  • Understand the scope of your migration using gh-repo-stats and/or gh-migration-analyzer

Users:

  • Provision / Invite users in EMU environment
  • Mapping of github handles from GHEC to GHEC-EMU

Workstation:

Repositories:

  • Perform a cleanup on repositories (eg. delete stale branches, history, expired objects, etc.)
    • Run git-sizer on repos
    • Remove sensitive data from repos
    • Remove large binaries from git history using git-filter-repo
    • Convert to LFS if needed. Generate csv mapping file of the old shas to the new ones using git lfs --object-map=<path> command. This can be useful for updating the repo metadata during the migration process.
  • Commit and push any changes, branches, pull requests, etc.

After Migration
Organization:

  • After migration has been completed and verified, we can rename old organizations to a different name and update the new organization with the name preferred.

Users:

  • Create new Personal Access Tokens or SSH keys in EMU environment

Repos:

CI/CD:

  • Update tokens and creds used by your CI/CD pipelines.
  • Update your CI/CD pipelines to point to the new GitHub repos.

I encourage you to do test runs of the migration, and inspect the results to be sure everything is moving over as expected. When you do the real migration, you'll want to lock the source repos during migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment