···24Which might lead to an even more involved migration.
25:::
2600000000000000000000000000000000000027### Full-Migration {#module-forgejo-migration-gitea-default}
2829This will migrate the state directory (data), rename and chown the database and
···48chown -R forgejo:forgejo /var/lib/forgejo
49systemctl restart forgejo
50```
005152### Alternatively, keeping the gitea user {#module-forgejo-migration-gitea-impersonate}
53
···24Which might lead to an even more involved migration.
25:::
2627+::: {.warning}
28+The last supported version of Forgejo which supports migration from Gitea is
29+*10.0.x*. You should *NOT* try to migrate from Gitea to Forgejo `11.x` or
30+higher without first migrating to `10.0.x`.
31+32+See [upstream migration guide](https://forgejo.org/docs/latest/admin/gitea-migration/)
33+34+The last supported version of *Gitea* for this migration process is *1.22*. Do
35+*NOT* try to directly migrate from Gitea *1.23* or higher, as it will likely
36+result in data loss.
37+38+See [upstream news article](https://forgejo.org/2024-12-gitea-compatibility/)
39+:::
40+41+In order to migrate, the version of Forgejo needs to be pinned to `10.0.x`
42+*before* using the latest version. This means that nixpkgs commit
43+[`3bb45b041e7147e2fd2daf689e26a1f970a55d65`](https://github.com/NixOS/nixpkgs/commit/3bb45b041e7147e2fd2daf689e26a1f970a55d65)
44+or earlier should be used.
45+46+To do this, temporarily add the following to your `configuration.nix`:
47+48+```nix
49+{ pkgs, ... }:
50+let
51+ nixpkgs-forgejo-10 = import (pkgs.fetchFromGitHub {
52+ owner = "NixOS";
53+ repo = "nixpkgs";
54+ rev = "3bb45b041e7147e2fd2daf689e26a1f970a55d65";
55+ hash = "sha256-8JL5NI9eUcGzzbR/ARkrG81WLwndoxqI650mA/4rUGI=";
56+ }) {};
57+in
58+{
59+ services.forgejo.package = nixpkgs-forgejo-10.forgejo;
60+}
61+```
62+63### Full-Migration {#module-forgejo-migration-gitea-default}
6465This will migrate the state directory (data), rename and chown the database and
···84chown -R forgejo:forgejo /var/lib/forgejo
85systemctl restart forgejo
86```
87+88+Afterwards, the Forgejo version can be set back to a newer desired version.
8990### Alternatively, keeping the gitea user {#module-forgejo-migration-gitea-impersonate}
91