···2424Which might lead to an even more involved migration.
2525:::
26262727+::: {.warning}
2828+The last supported version of Forgejo which supports migration from Gitea is
2929+*10.0.x*. You should *NOT* try to migrate from Gitea to Forgejo `11.x` or
3030+higher without first migrating to `10.0.x`.
3131+3232+See [upstream migration guide](https://forgejo.org/docs/latest/admin/gitea-migration/)
3333+3434+The last supported version of *Gitea* for this migration process is *1.22*. Do
3535+*NOT* try to directly migrate from Gitea *1.23* or higher, as it will likely
3636+result in data loss.
3737+3838+See [upstream news article](https://forgejo.org/2024-12-gitea-compatibility/)
3939+:::
4040+4141+In order to migrate, the version of Forgejo needs to be pinned to `10.0.x`
4242+*before* using the latest version. This means that nixpkgs commit
4343+[`3bb45b041e7147e2fd2daf689e26a1f970a55d65`](https://github.com/NixOS/nixpkgs/commit/3bb45b041e7147e2fd2daf689e26a1f970a55d65)
4444+or earlier should be used.
4545+4646+To do this, temporarily add the following to your `configuration.nix`:
4747+4848+```nix
4949+{ pkgs, ... }:
5050+let
5151+ nixpkgs-forgejo-10 = import (pkgs.fetchFromGitHub {
5252+ owner = "NixOS";
5353+ repo = "nixpkgs";
5454+ rev = "3bb45b041e7147e2fd2daf689e26a1f970a55d65";
5555+ hash = "sha256-8JL5NI9eUcGzzbR/ARkrG81WLwndoxqI650mA/4rUGI=";
5656+ }) {};
5757+in
5858+{
5959+ services.forgejo.package = nixpkgs-forgejo-10.forgejo;
6060+}
6161+```
6262+2763### Full-Migration {#module-forgejo-migration-gitea-default}
28642965This will migrate the state directory (data), rename and chown the database and
···4884chown -R forgejo:forgejo /var/lib/forgejo
4985systemctl restart forgejo
5086```
8787+8888+Afterwards, the Forgejo version can be set back to a newer desired version.
51895290### Alternatively, keeping the gitea user {#module-forgejo-migration-gitea-impersonate}
5391