Migration
TL;DR
If you were using sqlite (NixOS default), copy your Gitea database over the auto-generated blank Forgejo database with cp /var/lib/forgejo/data/gitea.db /var/lib/forgejo/forgejo.db
.
Complete Instructions
I decided to switch from self-hosting Gitea to Forgejo for reasons. To start, I followed official migration instrucitons but did a few things differently on account of running NixOS:
systemctl stop gitea
- Do NOT copy
app.ini
(it isn’t there, it’s part of your system nix config and will be built automatically) - Perform data migration as noted
- Switch
services.gitea
section in your system config toservices.forgejo
. nixos-rebuild switch
After doing this, I could access the interface but my existing users and repos were missing.
The reason I’m writing this article is to let you know that you need to copy /var/lib/forgejo/data/gitea.db
to /var/lib/forgejo/data/forgejo.db
.
There will be a forgejo.db
file in place without your data.
To continue with the steps:
systemctl stop forgejo
cp /var/lib/forgejo/data/gitea.db /var/lib/forgejo/forgejo.db
systemctl start forgejo
If your setup is the same as mine:
- you should be able to access the web UI
- your Gitea username/password should work
- your previously existing repos should show up on the “Explore” page
The last thing I did was select the default Forgejo theme in my users settings.
Hopefully this saves you a few minutes.
Comments