h44z / gitlab_to_gitea Goto Github PK
View Code? Open in Web Editor NEWGitlab to Gitea migration script.
License: MIT License
Gitlab to Gitea migration script.
License: MIT License
Thanks for this great script!
I used it to migrate my Gitlab 15.11.9 instance to Gitea 1.20.5.
FYI:
Since I have a reverse proxy which adds SSl, I got the following warning which in the end leads to failure:
migrate.py:54: UserWarning: The base URL in the server response differs from the user-provided base URL (https://git.home.***.ch -> http://gitlab-15.11).
This is usually caused by a misconfigured base URL on your side or a misconfigured external_url on the server side, and can lead to broken pagination and unexpected behavior. If this is intentional, use `keep_base_url=True` when initializing the Gitlab instance to keep the user-provided base URL. (python-gitlab: ***/gitlab/client.py:603)
gl.auth()
Adding keep_base_url=True
to gl = gitlab.Gitlab()
solved the issue and the migration was successful.
The function get_user_or_group only works with users, not with groups. Adding an org option might fix it
Hi, I'm not familiar with python, so I can't figure it out. Could you help, what I can miss? Installation of requirements passed fine, but running the script isn't.
# python3 -V
Python 3.5.3
# python3 migrate.py
File "migrate.py", line 69
label_response: requests.Response = gitea_api.get("/repos/" + owner + "/" + repo + "/labels")
^
SyntaxError: invalid syntax
I'm getting a lot of user doesn't have access to repo
errors while migrating, even tho I'm supposed to be the one creating the repos right?
import failed: {"message":"Authentication failed: Clone: exit status 128 - remote: HTTP Basic: Access denied\nfatal: Authentication failed
this can fix it #22
after fixed,it is ok now
Project mall-microservice not found in Gitea, importing!
ESC[94mProject mall-microservice imported!ESC[0m
Hello,
Gitea 1.12.4 importing GitLab 13.3.5, Python 3.8.
I've imported ~ 120 repositories across five organizations. All worked really well. Note I don't use issues, CI/CD, etc in GitLab.
However, in Gitea when I compare commits and click on "View File" I get a 404 error. At first I thought this was a proxy problem and fought it via Nginx for quite some time. Eventually after no relief, I went back and did a few manual imports through the Gitea front end (menu / new migration). The same project imported that way does not give the 404 error when attempting to view the same file; all projects I imported using this method come in without the error, while 100% of the script imports have the problem.
Is there anything I can do to assist or troubleshoot?
Best,
--J
Codeberg is based on Forgejo, which is a soft fork of Gitea so it should work, right?
Hi,
i try to migrate some all my project from gitlab to gitea because gitlab problem on write new repo. After create all group/society i receive this error.
sync_1 | The above exception was the direct cause of the following exception:
sync_1 |
sync_1 | Traceback (most recent call last):
sync_1 | File "migrate.py", line 650, in
sync_1 | main()
sync_1 | File "migrate.py", line 55, in main
sync_1 | import_projects(gl, gt)
sync_1 | File "migrate.py", line 556, in import_projects
sync_1 | projects: gitlab.v4.objects.Project = gitlab_api.projects.list(all=True)
sync_1 | File "/usr/local/lib/python3.6/site-packages/gitlab/exceptions.py", line 306, in wrapped_f
sync_1 | raise error(e.error_message, e.response_code, e.response_body) from e
sync_1 | gitlab.exceptions.GitlabListError: 500: 500 Internal Server Error
gitlab_to_gitea_sync_1 exited with code 1
any sugest?
thank you
Hi,
it seems this script only does a full migration. It would be nice if a target organisation could be specified into which the repositories are migrated. Similarly, it would be great if as source URL a GitLab group could be given.
Hi,
maybe I need a little bit more steps.
I tried your script with python 3.7.4
and installed pygitea and python-gitlab via pip.
I configured the user source with ldap in gitea and tried
to import everything else with the script.
I get this bug:
No public keys for user feng, importing!
Traceback (most recent call last):
File "./migrate.py", line 619, in <module>
main()
File "./migrate.py", line 56, in main
import_users_groups(gl, gt)
File "./migrate.py", line 535, in import_users_groups
_import_users(gitea_api, users, notify)
File "./migrate.py", line 462, in _import_users
_import_user_keys(gitea_api, keys, user)
File "./migrate.py", line 471, in _import_user_keys
"title": key.title,
TypeError: post() got an unexpected keyword argument 'json'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.