Migrate from Azure to Forgejo
Find a file
2026-03-22 13:27:32 +02:00
cmd Initial commit 2026-03-22 12:15:18 +02:00
internal Migrate pipelines - Best Effort 2026-03-22 13:27:32 +02:00
.env.example Initial commit 2026-03-22 12:15:18 +02:00
.gitignore Prepare for unit tests 2026-03-22 12:51:13 +02:00
go.mod Migrate pipelines - Best Effort 2026-03-22 13:27:32 +02:00
go.sum Migrate pipelines - Best Effort 2026-03-22 13:27:32 +02:00
LICENSE Initial commit 2026-03-22 12:15:18 +02:00
main.go Initial commit 2026-03-22 12:15:18 +02:00
README.md Initial commit 2026-03-22 12:15:18 +02:00

azure_migrate

Migrate from Azure to Forgejo

Usage Instructions

Create your .env file:

bash

cp .env.example .env

List repositories first (dry view):

bash

go run main.go list

Run migration (dry run):

bash

go run main.go migrate --dry-run

Execute actual migration:

bash

go run main.go migrate

Key Features

LFS Support:

The LFS: true flag in the migration request tells Forgejo to mirror LFS objects automatically.

Concurrent Processing:

Uses worker pools to migrate multiple repositories simultaneously (configurable via CONCURRENT_MIGRATIONS).

Detailed Error Handling:

Errors include repository name, project context, and specific failure reasons Non-fatal errors don't stop the entire process Summary report at the end

Azure Authentication:

Properly handles Azure DevOps PAT authentication via Basic Auth header.

Dry Run Mode:

Test the migration without creating any repositories.

Mirror Configuration:

Sets up Forgejo to periodically sync from Azure DevOps using the Interval setting.

Important Notes

Network Access:

Ensure the machine running this has access to both Azure DevOps and your Forgejo instance.

Storage:

Forgejo must have sufficient storage for LFS objects.

Permissions:

Azure PAT needs "Code (read)" permissions Forgejo token needs repository creation permissions

Existing Repositories:

The tool skips if a repository already exists (to prevent overwrites).

LFS in Mirrors:

Forgejo will handle LFS objects during the initial clone and subsequent syncs automatically when LFS: true is set.