How to backup, upgrade and migrate


My company is currently considering to start using Gitea. However, in a corporate environment, there are a couple of things we want to make sure we’ll be able to do before committing to a new software solution.

  1. Backup and restore (data safety)

    We want to be sure that if the machine hosting the service crashes, we can recover the data and restore the service on another one. I saw that a backup/restore feature is currently being worked on, but I also would like to know if restoring the database and repositories without it (by simply copying dump contents to the appropriate paths) works. It turned out to break easily on Gogs (without the backup/restore feature which was introduced after I made these tests).

  2. Upgrade (using a newer version of Gitea)

    AFAIK, the documentation does not mention how to upgrade to a newer version of Gitea. My guess would be that just replacing the binary with the newer one is enough, but am I right?

  3. Migrate (to a new machine)

    This topic is closely related with that of backup and restore. It might happen that we have to migrate the service to another machine, and therefore restore a backup in an environment different from the source out (e.g. with different paths). Would that be possible?

Thank you for the great work you’ve been doing on this piece of software. I’d like to use Gitea rather than Gogs because I prefer community projects, so I hope these issues (esp. 1 and 3) can be addressed.


One last thing you may want to check is the life cycle policy / roadmap.
I opened a bug on this topic.
My understanding is that you might get in trouble every 2 months when updating.
the project, in general might be a little early for prime time. Anyone using gitea for many repos?


Your git data is stored in bare git repos on disk in your data directory.

The repo and user management is in MySQL database.

Disaster recovery should include backing up the data directory, the config and any templates you’ve customized and backing up the MySQL database.

In my setup the gitea directory has everything except the database but I have cron dump the DB and zip up a copy of the gitea directory daily.

Upgrade is as easy as stop the service and replace the binary, and start up again.
I’ve had trouble where I customized a template and it didn’t display right after update but it was pretty obvious and easy to fix.


You don’t happen to have a script to copy those dumps to an S3 bucket would you?


Sorry guy. I’m not sending them to s3. Looks like there are a couple ways to do that.


If using docker-compose to manage your stack upgrading gitea can be as simple as running a few commands. However, there may be some caveats which I’ve broken out into a separate discussion in Upgrade Gitea Docker Compose.