Package: ghec-migration
Github Enterprise cloud migration toolThis tool helps you do the below tasksGithub MigrationJenkins BMX MigrationMake repos privateUpdate topicsFind new git URL for CI/CD changes (SNOW)Github MigrationMigrates provided github repos from source org to target organizationGenerate Github Personal Access TokenFollow the stepshereto generate personal access token. Copy the token.For github enterprise cloud, the token should be enabled with SAML SSOFollow the stepshereAccess NeededThe user who is running this tool, should be an admin on the source organization.Make Repos privateBefore running the tool for migration make all the repos private. You have to be an admin on the organization to do soGithub Migration
? What do you want to do?  Make repos private
? Organization Name  nike-platform-fulfillment
? github personal access token  ****************************************
tesactions is internal, making it private
Made tesactions private for transfer
tesactions is internal, making it privateRunning the toolInstall python3On MAC OS -brew install python3On Windows, download the installer fromhereRun the below command to install the github migration toolpip3 install --upgrade ghec-migrationInvoke the tool by runningghec-migrationNote: Set logging level by using environment variableLOGLEVEL. Default isINFOexportLOGLEVEL=DEBUGOutput of the tool➜~ghec-migration
GithubMigration
?Whatdoyouwanttodo?GithubMigration
?Sourcegithuborgnike-platform-fulfillment
?Targetgithuborgnike-internal
?TargetTeamSlugfulfillment-squad-artemis
?TargetTeamAdminSlugfulfillment-admins
?TeamPrefixfulfillment
?Githubaccesstoken<token>
?Howdoyouwanttogettherepos?ProvidelistofRepos
?Providethefilewiththereponamestobemigrated/Users/vmari2/repos.txt#outputLoggedinasuservmari2_nike
Readingreposfrom/Users/vmari2/repos.txt

Transferringpublishgempoctotargetorganization
Addinguservmari2_nikeasadmingtorepopublishgempoc
Uservmari2_nikeaddedasadmintotherepopublishgempoc
Renamingpublishgempoctofulfillment.publishgempoc
Renamedsuccessfully
Renamingmastertomain
Renamedmastertomain
Transferringrepopublishgempoctonike-internal
Transfercompletedforrepopublishgempoc
changingteamlevelaccess
Changedfulfillmenttobeapush
Changedfulfillment-squad-artemistobeamaintain
Changedfulfillment-adminstobeaadmin
Changedfulfillment-external-contributorstobeapush
Madepublishgempocinternalaftertransfer
Removinguservmari2_nikeasadmingtorepopublishgempoc
Uservmari2_nikeremovedasadmintotherepopublishgempoc
CompletedtransferforpublishgempocJenkins MigrationWe can change the github url in the bmx job using this toolGenerate a jenkins following the stepshereYou can provide the list of jobs you want to change. Create a text file with all the jobs you want to reconfigure. Example can be foundhereif you don't provide the list of jobs, all the jobs in the jenkins instance will be reconfiguredGithubMigration
?Whatdoyouwanttodo?JenkinsBMXMigration
?Providethejenkinsurlhttps://logistics.jenkins.bmx.nikecloud.com/
?Providethefilewiththelistofjobs.Leaveblankifyouwanttoreconfigurealljobsinthejenkinsinstancejobs.txt
?JenkinsToken**********************************
?JenkinsUsernameVamsikrishna.Maringanti@nike.com
?NewGithubOrgnike-internal
?OldGithubOrg(s).Providecommaseparatedvaluesgflsdrepo
?TeamPrefixfulfillment
?ProvidethenewcredentialstoChangecredentialsid.LeaveblankifnotchangingUpdate Topics on reposThis script finds the repos on which the given team has the provided access levels. For example, if you want to update topics on repos wherefulfillment-squad-artemishasmaintainaccess provide the below informationArgumentsPostionArgumentDescription1Source_Orgthe github organization name Ex nike-internal2team_slugthe team slug Ex: fulfillment-squad-artemis3access_levelthe access level for the provided team - can take values ["push", "pull", "maintain", "admin", "triage"]4tokengithub access token5Additional TopicsProvide common separated topics ex: fulfillment,servicesGithubMigration
?Whatdoyouwanttodo?Updatetopics
?OrganizationNamenike-internal
?TeamSlugfulfillment-squad-artemis
?Selectthepermissionlevelmaintain
?Additionaltopics,commaseparatedartemis
?githubpersonalaccesstoken****************************************Find new urls for CI/CD template updateAs part of bulk migration, the CICD templates are updated with intermediate organization exnike-platform-logistics. You can use this tool to get the new URLs for the repos after migrationTo run this, you will need the list of old repo URLS. This can be exported fromservice nowCreate a textfilewith repo URLs. Run the tool selecting the right options?Whatdoyouwanttodo?FindnewgitURLforCI/CDchanges(SNOW)?Sourcegithuborganizationnike-platform-fulfillment
?FilepathforthelistofOldURLsold_urls.txt
?GithubToken****************************************
Gettingnewurlfororderstatus
Gettingnewurlfornikeidboxlabel
Gettingnewurlforgoodsissue
Gettingnewurlforfgwschedulers
Completedprocess.ThenewgitUrlscanbefoundatnew_references.csvWhat this tool will not doupdate QMA config in service nowUpdatemasterreferences tomainin Code like Jenkinsfile, etcIf you use build flows based on the branch, you have to update them accordinglyDoesn't organize bmx jobs into foldersIt can't skip bmx jobsTODOAdd branch protection rules and status checksUpdate Scan@Source metadata