4
1
Fork
You've already forked gitlab_to_forgejo
3
Gitlab to Forgejo migration script.
  • Python 100%
2026年01月10日 17:04:08 +01:00
fg_migration create purge script for forgejo 2024年09月03日 20:35:04 +02:00
.gitignore fir commit 2024年08月06日 16:38:47 +02:00
create_push_mirrors.py improved print option 2024年10月02日 19:03:42 +02:00
LICENSE first commit 2024年07月23日 19:06:10 +02:00
migrate.py fix issue/pull request migration 2025年10月26日 12:53:05 +02:00
purge_forgejo.py allow purge user data 2024年10月08日 15:01:31 +02:00
README.md remove WIP notice and update README preamble 2026年01月10日 16:55:32 +01:00
requirements.txt solves issue #2 2026年01月10日 17:04:08 +01:00

Gitlab to Forgejo migration script

Preamble

This script uses the Gitlab API and a combination of pyforgejo and python requests to migrate all data from Gitlab to Forgejo.

This script supports migration of:

  • Repositories & Wiki (fork status is lost)
  • Users (no profile pictures)
  • Groups
  • Public SSH keys

Tested with Gitlab Version 17.2.1 and Forgejo Version 8.0.0

Usage

How to use with venv

To keep your local system clean, it is preferrable to use a virtual environment. You can follow these steps:

python3 -m venv migration
source migration/bin/activate
python3 -m pip install -r requirements.txt

and you call the scripts using --help:

  • ./migrate.py --help
  • ./create_push_mirrors.py --help

ini file

You need to create a configuration file called .migrate.ini and store it in the same directory of the script.
💡 .migrate.ini is listed in .gitignore.

[migrate]
gitlab_url = https://gitlab.example.com
gitlab_token = <your-gitlab-token>
gitlab_admin_user = <gitlab-admin-user>
gitlab_admin_pass = <your-gitlab-password>
forgejo_url = https://forgejo.example.com
forgejo_token = <your-forgejo-token>
forgejo_admin_user = <forgejo-admin-user>
forgejo_admin_pass = <your-forgejo-password>

Credits and fork information

This is a fork of gitlab_to_gitea, with less features (this script does not import issues, milestones and labels)