2017-11-27 00:44:32 +03:00
---
date: "2016-12-01T16:00:00+02:00"
title: "Upgrade from Gogs"
slug: "upgrade-from-gogs"
weight: 10
toc: true
draft: false
menu:
sidebar:
parent: "upgrade"
name: "From Gogs"
weight: 10
identifier: "upgrade-from-gogs"
---
# Upgrade from Gogs
2018-01-09 01:48:42 +03:00
Gogs, version 0.9.146 and older, can be easily migrated to Gitea.
2017-11-27 00:44:32 +03:00
2018-01-09 01:48:42 +03:00
There are some basic steps to follow. On a Linux system run as the Gogs user:
2017-11-27 00:44:32 +03:00
2018-02-22 15:55:26 +03:00
* Create a Gogs backup with `gogs backup` . This creates `gogs-backup-[timestamp].zip` file
containing all important Gogs data. You would need it if you wanted to move to the `gogs` back later.
2018-01-09 01:48:42 +03:00
* Download the file matching the destination platform from the [downloads page ](https://dl.gitea.io/gitea ).
2018-02-22 15:55:26 +03:00
It should be `1.0.x` version. Migrating from `gogs` to any other version is impossible.
2017-11-27 00:44:32 +03:00
* Put the binary at the desired install location.
* Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini` .
2018-01-09 01:48:42 +03:00
* Copy custom `templates, public` from `gogs/custom/` to `gitea/custom/` .
* For any other custom folders, such as `gitignore, label, license, locale, readme` in
`gogs/custom/conf` , copy them to `gitea/custom/options` .
2017-11-27 00:44:32 +03:00
* Copy `gogs/data/` to `gitea/data/` . It contains issue attachments and avatars.
* Verify by starting Gitea with `gitea web` .
2018-01-09 01:48:42 +03:00
* Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file` .
* If custom or config path was changed, run `Rewrite all update hook of repositories` .
2017-11-27 00:44:32 +03:00
### Change gogs specific information:
* Rename `gogs-repositories/` to `gitea-repositories/`
* Rename `gogs-data/` to `gitea-data/`
2018-01-09 01:48:42 +03:00
* In `gitea/custom/conf/app.ini` change:
2017-11-27 00:44:32 +03:00
2018-02-22 15:55:26 +03:00
### Upgrading to most recent `gitea` version:
After successful migration from `gogs` to `gitea 1.0.x` it is possible to upgrade to the recent `gitea` version.
Simply download the file matching the destination platform from the [downloads page ](https://dl.gitea.io/gitea )
and replace the binary.
2017-11-27 00:44:32 +03:00
FROM:
```
[database]
PATH = /home/:USER/gogs/data/:DATABASE.db
[attachment]
PATH = /home/:USER/gogs-data/attachments
[picture]
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
[log]
ROOT_PATH = /home/:USER/gogs/log
```
TO:
```
[database]
PATH = /home/:USER/gitea/data/:DATABASE.db
[attachment]
PATH = /home/:USER/gitea-data/attachments
[picture]
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
[log]
ROOT_PATH = /home/:USER/gitea/log
```
* Verify by starting Gitea with `gitea web`
### Troubleshooting
2018-01-09 01:48:42 +03:00
* If errors are encountered relating to custom templates in the `gitea/custom/templates`
folder, try moving the templates causing the errors away one by one. They may not be
compatible with Gitea or an update.
2017-11-27 00:44:32 +03:00
### Add Gitea to startup on Unix
2018-01-09 01:48:42 +03:00
Update the appropriate file from [gitea/contrib ](https://github.com/go-gitea/gitea/tree/master/contrib )
with the right environment variables.
2017-11-27 00:44:32 +03:00
2018-01-09 01:48:42 +03:00
For distros with systemd:
2017-11-27 00:44:32 +03:00
* Copy the updated script to `/etc/systemd/system/gitea.service`
* Add the service to the startup with: `sudo systemctl enable gitea`
* Disable old gogs startup script: `sudo systemctl disable gogs`
2018-01-09 01:48:42 +03:00
For distros with SysVinit:
2017-11-27 00:44:32 +03:00
* Copy the updated script to `/etc/init.d/gitea`
* Add the service to the startup with: `sudo rc-update add gitea`
* Disable old gogs startup script: `sudo rc-update del gogs`