Code Monkey home page Code Monkey logo

migrategitlabtogogs's Introduction

Migration utility for moving from Gitlab to Gogs / Gitea

This tools provides an automated way to copy all repositories in a namespaces from Gitlab to Gogs / Gitea. All tags and branches are copied. Organizations in Gogs are supported as well.

Usage

Type python migrate_gitlab_to_gogs.py --help for usage information. It will print

usage: migrate_gitlab_to_gogs.py [-h] --source_namespace SOURCE_NAMESPACE
                                 [--add_to_private]
                                 [--add_to_organization organization_name]
                                 --source_repo SOURCE_REPO --target_repo
                                 TARGET_REPO [--no_confirm]

optional arguments:
  -h, --help            show this help message and exit
  --source_namespace SOURCE_NAMESPACE
                        The namespace in gitlab as it appears in URLs. For
                        example, given the repository address
                        http://mygitlab.com/harry/my-awesome-repo.git, it
                        shows that this repository lies within my personal
                        namespace "harry". Hence I would pass harry as
                        parameter.
  --add_to_private      If you want to add the repositories under your own
                        name, ie. not in any organisation, use this flag.
  --add_to_organization organization_name
                        If you want to add all the repositories to an
                        exisiting organisation, please pass the name to this
                        parameter. Organizations correspond to groups in
                        Gitlab. The name can be taken from the URL, for
                        example, if your organization is http://mygogs-
                        repo.com/org/my-awesome-organisation/dashboard then
                        pass my-awesome-organisation here
  --source_repo SOURCE_REPO
                        URL to your gitlab repo in the format
                        http://mygitlab.com/
  --target_repo TARGET_REPO
                        URL to your gogs / gitea repo in the format
                        http://mygogs.com/
  --no_confirm          Skip user confirmation of each single step

Requirements

This tools was written for Python 3 using the requests, json, subprocess, and argparse modules.

migrategitlabtogogs's People

Contributors

marcelsimon avatar micw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

migrategitlabtogogs's Issues

Feature: Option to automatically continue

There should be an option to continue

  • if everything was fine
  • if a remote repository already exists

When importing a large number of repos, the user otherwise has to confirm each single one.

Does this also migrate issues?

Hi there,

Does this also migrate issues and user info? What about the Wiki?
Could you please update your readme on the full range of migration?

Thank you!

ValueError on importing 1st repo

Hey MarcelSimon your migration script looks pretty neat.

I've tried to migrate my repo's from Gitlab, detection and API calls are working fine.
However on the migration of the first repo I am getting this error:

Migrating project git@********.nl:PetervdPerk/GLT-Assign2.git to project GLT-Assign2 now.
Do you want to continue? (please answer yes or no) yes
Traceback (most recent call last):
File "migrate_gitlab_to_gogs.py", line 107, in
print('Could not create repo %s because of %s'%(src_name,json.loads(create_repo.text)['message']))
File "/usr/lib/python3.4/json/init.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

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.