Switching a YNH App to a fork of this App

Is there an easy way to switch from an App (say Gitea) to a compatible fork of this app (say in this case Forgejo)?

1 Like

Yes, by uninstalling Gitea and installing Forgejo instead

…and what about my existing repos and user accounts?
The true question is transition not install/uninstall.
:face_with_spiral_eyes:

1 Like

Are they compatible ?
For instance could the database be merged from a Gitea backup to a Forgejo backup restore ?

In this case, the forgejo app should integrate a specific upgrade procedure (like we did for owncloud / nextcloud or other similar cases).

2 Likes

Forgejo is a soft fork totaly compatible with Gitea.
A special upgrade procedure will be a good (and great idea).

Something like this was made a few months ago here vaultwarden_ynh/ynh_handle_app_migration at master · YunoHost-Apps/vaultwarden_ynh · GitHub for the migration from bitwarden to vaultwarden. If you’d like to contribute this script might be a good starting point.

Thanks I will look at this…

I found also this App who recently change of name:

Gitea was previously migrated from Gogs (migrating from Gitea to Forgejo may be similar):

There is also a new Forgejo app. Maybe it is sufficient to copy/move the app data from Gitea to Forgejo?

1 Like

The code shown by @snm is when the gogs package was renamed gitea. I’m not sure of that, @Josue should be asked about this.
In the case of forgejo, the two packages (forgejo and gitea) will continue to live along side.
No migration is planned in the forgejo package.

But forgejo itself can help you to migrate your data from any gitea instance. Go to https://your-domain.tld/forgejo/repo/migrate and select gitea.
I think it’s the best way to migrate from an application to another.

1 Like

I’m a bit confused now because there is still a Gogs app.

Thanks for the info, I’ll try that.
And thank you for your work on the Forgejo package! :slight_smile:

My question was about to transform my Gitea instance to Forgejo, not about to install Forgejo and migrate my Gitea data…

If I undestand well the few information on Forgejo website, it’s simple as replacing the Gitea binary by the Forgejo one, and updating/upgrading the default theme.

It’s more complex with YNH because we have also to “migrate” the directory (/home/yunohost.app/gitea/) and change user ownership on files (from gitea to forgejo I presume).

Finaly I will uninstall Gitea without installing Forgejo.

1 Like

But forgejo itself can help you to migrate your data from any gitea instance. Go to https://your-domain.tld/forgejo/repo/migrate and select gitea.
I think it’s the best way to migrate from an application to another.

I think that one of the most realistic use case scenarios is when someone who maintained gitea instance for their community / circle-of-friends (after all servers running yunohost are not supposed to be single-person) wants to switch to forgejo instead.

With forgejo / gitea repository migrate feature, such an admin would have to set up a separate forgejo instance on a separate domain (or under a separate path); ask everybody to register in forgejo (unless gitea was configured to use yunohost user management), to set up their profiles, add ssh keys, configure 2FA etc (and their old access tokens and connected oauth apps will break anyway); and ask them to migrate every one of their repositories one-by one. Similarly someone would have to create all organizations that existed in gitea, configure them, configure access, migrate repositories one-by-one (I’d also imagine that this will likely break association between issues/PRs/comments and their authors); and then an admin would have to disable gitea (or to move it to yet another address so that people who did not yet migrate will not lose their data) and to move forgejo to the address previously used by gitea.

This sounds like an extreme overkill for what can, on non-yunohost systems, be achieved simply by dropping forgejo executable in place of gitea executable.

1 Like

You can find the way we have migrated our Gitea instance to ForgeJo in this post : How to migrate Gitea to ForgeJo