Skip to content

nandagirin/gitlab-to-gitlab-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitLab to GitLab Migration

This repo contains script to migrate a GitLab project from one GitLab host to another (e.g self hosted GitLab to GitLab SaaS).

The Golang script will run through the migration process, mainly by calling related APIs in source Gitlab project and destination Gitlab project. You could refer to this documentation for detailed explanation regarding the APIs. The migration itself will execute below process:

archvie source project -> export source project -> get export status until finished -> download exported project -> import project to destination gitlab -> unarchive imported project

To run the script, below environment variables are needed:

  • SOURCE_GITLAB_URL: source gitlab url starting with protocol without trailing slash e.g https://gitlab.example.com
  • SOURCE_GITLAB_PROJECT_ID: project id of source project, could be found on the repo page
  • SOURCE_GITLAB_PRIVATE_TOKEN: gitlab personal access token that has read/write access to source project
  • DESTINATION_GITLAB_URL: destination gitlab url starting with protocol without trailing slash e.g https://gitlab.com
  • DESTINATION_GITLAB_PRIVATE_TOKEN: gitlab personal access token that has read/write access to destination path where project will be imported
  • DESTINATION_GITLAB_NAMESPACE_NAME: project namespace or path before the project name e.g backend/golang
  • DESTINATION_GITLAB_PROJECT_NAME: imported project name e.g auth-service

Running the script locally

Pre-requisite

Install Golang

Refer to this document to install golang.

Run the script

Provide environment variables explained above. Then, on the root folder of this repo, run below command:

go run *.go

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages