# How to backup, upgrade and migrate

**URL:** <https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124>\
**Category:** Install/Maintain/Configure\
**Created:** [November 22, 2017, 10:51am UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124 "2017-11-22T10:51:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![momom4urice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/momom4urice/32/4716_2.png) [@momom4urice](https://forum.gitea.com/u/momom4urice)\
**Post date:** [November 22, 2017, 10:51am UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124/1 "2017-11-22T10:51:56Z")

</div>

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)

2. Upgrade (using a newer version of Gitea)

3. Migrate (to a new machine)

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.

---

<div class="post-metadata">

**Author:** ![Ian](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ian/32/87_2.png) [@Ian](https://forum.gitea.com/u/Ian)\
**Post date:** [November 24, 2017, 9:03pm UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124/2 "2017-11-24T21:03:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![derak-kilgo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/derak-kilgo/32/4708_2.png) [@derak-kilgo](https://forum.gitea.com/u/derak-kilgo)\
**Post date:** [November 26, 2017, 5:16pm UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124/3 "2017-11-26T17:16:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon74399538](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon74399538](https://forum.gitea.com/u/anon74399538)\
**Post date:** [July 7, 2018, 7:42am UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124/4 "2018-07-07T07:42:52Z")

</div>

> [@derak-kilgo](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![derak-kilgo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/derak-kilgo/32/4708_2.png) [@derak-kilgo](https://forum.gitea.com/u/derak-kilgo)\
**Post date:** [July 8, 2018, 10:15am UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124/5 "2018-07-08T10:15:17Z")

</div>

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

> <https://superuser.com/questions/279986/uploading-files-to-s3-account-from-linux-command-line>

---

<div class="post-metadata">

**Author:** ![anon74399538](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon74399538](https://forum.gitea.com/u/anon74399538)\
**Post date:** [July 16, 2018, 8:36am UTC](https://forum.gitea.com/t/how-to-backup-upgrade-and-migrate/124/7 "2018-07-16T08:36:32Z")

</div>

> [@momom4urice](#):
>
> 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?

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](https://forum.gitea.com/t/upgrade-gitea-docker-compose/427).
