mirror of
https://github.com/go-i2p/gitlab-to-gitea.git
synced 2025-06-08 01:09:14 -04:00
c4c5aafbcf5cfc04403b0b3a59952bc45fc67903
gitlab-to-gitea
Go-based tool for migrating GitLab repositories, users, groups, issues and related data to Gitea instances.
More-or-less a port of gitlab-to-gitea from python to Go because fixing python appears to be a thing I just can't get my mind around, but rewriting it? I'm actually OK at that.
Core Functionality
- Migrates users, groups, and their relationships from GitLab to Gitea
- Transfers repositories with labels, milestones, issues, and comments
- Preserves user relationships (collaborators) and SSH keys
- Supports resumable migrations through state tracking
- Handles username normalization and entity mapping between platforms
Installation
- Ensure Go 1.24+ is installed
- Clone the repository:
git clone https://github.com/go-i2p/gitlab-to-gitea.git cd gitlab-to-gitea
- Install dependencies:
go mod download
- Build the executable:
go build -o gitlab-to-gitea ./cmd/migrate/
Configuration
- Copy the example environment file:
cp _env.example .env
- Edit
.env
with your GitLab and Gitea details:GITLAB_URL=https://your-gitlab-instance.com GITLAB_TOKEN=your-gitlab-token GITEA_URL=https://your-gitea-instance.com GITEA_TOKEN=your-gitea-token
Usage
Execute the migration tool after configuration:
./gitlab-to-gitea
The tool will:
- Connect to both GitLab and Gitea instances
- Migrate users and groups first
- Migrate projects with all associated data
- Track progress in
migration_state.json
(resumable if interrupted)
Key Dependencies
- github.com/xanzy/go-gitlab: GitLab API client
- github.com/joho/godotenv: Environment variable handling
- github.com/go-sql-driver/mysql: Optional database connectivity for action import
Optional Features
For commit action import to Gitea's activity timeline:
- Configure database details in
.env
- Generate a commit log file
- Use the database import functionality in the
gitea
package
License
MIT License
Languages
Go
99.4%
Makefile
0.6%