Giter VIP home page Giter VIP logo

gitlab-migration's Introduction

gitlab-migration

docker image

Migrate GitLab repositories to other GitLab server

Requirements

  • Python 3

Configuration

Open python-gitlab.cfg file and change src and dest sections.

You can create private token at Personal Access Tokens menu.

See python-gitlab Configuration for detailed configuration description.

  • default: source gitlab connection
  • ssl_verify: verify the SSL certificate
  • timeout: Number of seconds to wait for an answer before failing.

Override with env

Tou can override existing configurations using environment variables.

variable name prefix:

  • GITLAB_SRC_: src group variables
  • GITLAB_DEST_: dest group variables

variable name and configuration mapping:

env name configuration
SSL_VERIFY ssl_verify
TIMEOUT timeout
PRIVATE_TOKEN private_token
HTTP_USERNAME http_username
HTTP_PASSWORD http_password
OAUTH_TOKEN oauth_token
JOB_TOKEN job_token

Run

Run from source

# setup virtual environments
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ python -m pip install pip-tools
(venv) $ pip install -r requirements.txt

# Migrate
$ GITLAB_SRC_GROUP_ID=1234 \
  GITLAB_DEST_GROUP_ID=5678 \
  python migrate.py

# Migrate using export/import
$ GITLAB_EXPORT_IMPORT=True \
  GITLAB_SRC_GROUP_ID=1234 \
  GITLAB_DEST_GROUP_ID=5678 \
  python migrate.py

# Migrate using export/import. overwrite existing project if exists.
$ GITLAB_EXPORT_IMPORT=True \
  GITLAB_IMPORT_OVERWRITE=True \
  GITLAB_SRC_GROUP_ID=1234 \
  GITLAB_DEST_GROUP_ID=5678 \
  python migrate.py

Environments:

  • GITLAB_SRC_GROUP_ID: source gitlab group id (required)
  • GITLAB_DEST_GROUP_ID: destination gitlab group id (required)
  • GITLAB_EXPORT_IMPORT: default value is False
  • GITLAB_IMPORT_OVERWRITE: default value is False
    • True: overwrite existing dest project.
    • False: throws exception if dest project exists.

You can find Group ID at 'group overview' page.

Run with docker image

$ GITLAB_SRC_GROUP_ID={srcGroupId} GITLAB_DEST_GROUP_ID={destGroupId} \
  docker-compose run --rm lechuckroh/gitlab-migration

Limitations

migration items

The following items are migrated if use_export is False.

item support
git O
issues
labels
pipelines
runners
settings
snippets
wiki

gitlab-migration's People

Contributors

lechuckroh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.