Youtube Video

Summary published at 9/13/2024

🚀 Migration Overview: Let's get started with migrating a repository using the GitHub CLI.

💻 Step 1: Ensure the GitHub CLI is installed. Type GH in your terminal to check.

🔧 Step 2: Check installed extensions with GH extension list. Ensure you have the GitHub Enterprise importer installed.

📦 Step 3: To migrate a repository, you need to specify:

  • Source Organization
  • Source Repository
  • Target Organization

🔑 Step 4: Create two personal access tokens (one for source and one for target). Ensure they have the necessary scopes: repo, workflow, admin.

🌍 Step 5: Set up environment variables for the tokens:

export GH_SOURCE_PAT=
export GH_PAT=

⚙️ Step 6: Run the migration command:

GH gii migrate repo --source-org --source-repo --target-org

Step 7: Monitor the migration process. It typically takes 40 to 60 seconds.

📜 Step 8: After migration, check for logs. You can download them using:

GH gii download logs

🔍 Step 9: Review the migrated repository. Check for issues, pull requests, and ensure everything is in order.

📝 Step 10: If needed, map old users to new users to avoid "mannequin" tags.

🔄 Step 11: To change the repository name during migration, use the --target-repo option.

Step 12: If your repository has releases, consider using the --skip-releases option to reduce size.

⏱️ Important Note: Larger repositories may take longer to migrate. Always perform dry runs to estimate migration time.

Conclusion: You have successfully migrated a single repository using the GitHub Enterprise importer. Future videos will cover more complex scenarios.

Download our Chrome extension for Youtube summaries