nixos/forgejo: document migration version restrictions (#406169)

authored by Adam C. Stephens and committed by GitHub 6701894f 31458db2

+38
+38
nixos/modules/services/misc/forgejo.md
··· 24 24 Which might lead to an even more involved migration. 25 25 ::: 26 26 27 + ::: {.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 + 27 63 ### Full-Migration {#module-forgejo-migration-gitea-default} 28 64 29 65 This will migrate the state directory (data), rename and chown the database and ··· 48 84 chown -R forgejo:forgejo /var/lib/forgejo 49 85 systemctl restart forgejo 50 86 ``` 87 + 88 + Afterwards, the Forgejo version can be set back to a newer desired version. 51 89 52 90 ### Alternatively, keeping the gitea user {#module-forgejo-migration-gitea-impersonate} 53 91