| .vscode | ||
| .gitignore | ||
| config.go | ||
| db.go | ||
| engine.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| secrets.go | ||
| table_migrations.go | ||
| tables.go | ||
gitea to forgejo migration, the hard way
I wrote this tool to automate migration from gitea to forgejo. Somebody told me this was "a drop-in replacement"... if you're here, you know it's not. In fact, it was until gitea v1.22, but now the two projects diverged too much.
Important notes
I wrote this to handle my specific use-case, with my specific gitea and forgejo versions. If everything is the same as my environment, with some luck, it works. If you use different versions, a different environment, you're practically on our own... But please contribute to this repo, in any case: if you're on this journey, let me know how you handled it.
My environment
I am moving some gitea instances (v1.25.2 on mariadb) to forgejo (13.0.3 on postgres), so I'm changing both application AND database.
I'm managing everything via docker compose.
how to do this migration
Pre-flight check
Check that source db is healthy.
docker compose exec -u git gitea gitea doctor check --run check-db-consistency --fix
(adapt this command to your environment)
backup now
Stop all container and make a backup. Really. This is important, don't skip this step.
run me
Build and run the program (look at ENV for configuration parameters).
go build .
export MARIADB_HOST=localhost
export MARIADB_PORT=3306
export MARIADB_USER=gitea
export MARIADB_PASSWORD=gitea
export MARIADB_DATABASE=gitea
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export POSTGRES_USER=forgejo
export POSTGRES_PASSWORD=forgejo
export POSTGRES_DATABASE=forgejo
export SECRET_KEY="KEEP IT SECRET!"
./gitea2forgejo # and pray