Gitea mirror gitea

Hello everyone I’m a newbie to gitea. I have two separate VMs with gitea installed. Please advise how I can correctly configure the second VM so that it acts as a mirror of the first VM, and all changes are reflected on the mirror as soon as they are made.

We have two organizations, with around 100 repositories, but we need 24/7 availability. Therefore, in the event of one server failing, a full and up-to-date copy should be available on the second server.

The simplest approach is to use the mirror function in the project settings to configure a project on your primary instance to be automatically pushed to the secondary instance. But this approach requires you to configure each project individually. However, if your number of projects is not increasing, you can choose this option. For configuration, you can do it manually or automate it using the gitea API: for each project on the primary instance, you create a project with the same name on the secondary instance, and configure the primary instance project to be mirrored by the secondary instance project. You need to maintain the user list on the secondary instance, and any API keys will not be the same on the secondary instance.
If the maximum downtime in the event of failure allows it, another approach (subject to validation by the community…) is to synchronize the repository filesystem. In the event of failure of the main instance, it would be sufficient to use the repositories/deprived repositories function (administration menu) to recreate the list of projects. It would also be necessary to manually recreate the list of users, groups, accesses, etc…
Other approaches exist, but they depend on your needs and constraints (TCO, RPO, costs, infrastructure capacity & capabilities, etc.). An incident recovery plan is a big subject in itself, as it depends on many factors and is a function of the types of incident envisaged.