How can i switch from gogs to gitea with less pain? #1554

Closed
opened 2025-11-02 04:04:43 -06:00 by GiteaMirror · 27 comments
Owner

Originally created by @iddm on GitHub (Feb 22, 2018).

Is there any manual for moving the git server from gogs to gitea? I'd like to save all my data which was created in gogs before: users, repoitories, settings, everything.

Originally created by @iddm on GitHub (Feb 22, 2018). Is there any manual for moving the git server from gogs to gitea? I'd like to save all my data which was created in gogs before: users, repoitories, settings, everything.
GiteaMirror added the type/question label 2025-11-02 04:04:43 -06:00
Author
Owner

@charlesreid1 commented on GitHub (Feb 22, 2018):

You want this: Upgrade from Gogs

@charlesreid1 commented on GitHub (Feb 22, 2018): You want this: [Upgrade from Gogs](https://docs.gitea.io/en-us/upgrade-from-gogs/)
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

Thank you very much!

@iddm commented on GitHub (Feb 22, 2018): Thank you very much!
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@charlesreid1 The manual is a bit outdated:

  1. There is no gogs dump anymore but gogs backup. It must be run under non-root user.

  2. I have this error during gitea web:

     Failed to initialize ORM engine: migrate: do migrate: Error 1146: Table 'gogs.repo_unit' doesn't exist
    
@iddm commented on GitHub (Feb 22, 2018): @charlesreid1 The manual is a bit outdated: 1. There is no `gogs dump` anymore but `gogs backup`. It must be run under non-root user. 2. I have this error during `gitea web`: Failed to initialize ORM engine: migrate: do migrate: Error 1146: Table 'gogs.repo_unit' doesn't exist
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

@vityafx What is your gitea version?

@appleboy commented on GitHub (Feb 22, 2018): @vityafx What is your gitea version?
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@appleboy

$ ./gitea-bin --version
Gitea version 1.4.0+rc1-12-g423c642 built with: bindata, sqlite
@iddm commented on GitHub (Feb 22, 2018): @appleboy ```bash $ ./gitea-bin --version Gitea version 1.4.0+rc1-12-g423c642 built with: bindata, sqlite ```
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

@vityafx I think you should try the v1.0 version. download from https://dl.gitea.io/gitea/

@appleboy commented on GitHub (Feb 22, 2018): @vityafx I think you should try the `v1.0` version. download from https://dl.gitea.io/gitea/
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@appleboy why so old?

@iddm commented on GitHub (Feb 22, 2018): @appleboy why so old?
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

You should migrate gogs to gitea v1.0 and then upgrade gitea from v1.0 to v1.4

@appleboy commented on GitHub (Feb 22, 2018): You should migrate gogs to gitea v1.0 and then upgrade gitea from v1.0 to v1.4
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@appleboy this also should be mentioned in the docs then.

@iddm commented on GitHub (Feb 22, 2018): @appleboy this also should be mentioned in the docs then.
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@appleboy It works so, confirmed: migrating from gogs to 1.0 gitea and then upgrading the gitea from 1.0 to 1.4. Thanks a lot.

@iddm commented on GitHub (Feb 22, 2018): @appleboy It works so, confirmed: migrating from gogs to 1.0 gitea and then upgrading the gitea from 1.0 to 1.4. Thanks a lot.
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

@vityafx Nice, we should update the document.

@appleboy commented on GitHub (Feb 22, 2018): @vityafx Nice, we should update the document.
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

@vityafx which version do you download? v1.0.x?

@appleboy commented on GitHub (Feb 22, 2018): @vityafx which version do you download? `v1.0.x`?
Author
Owner

@charlesreid1 commented on GitHub (Feb 22, 2018):

Documentation file needing updating is here: from-gogs.en-us.md, also in French and Chinese (dir).

@vityafx the first two instructions are probably the ones that need updating. Did gogs still generate gogs-dump-[timestamp].zip?

All: Does the second instruction need changing, or does it actually describe the process that was needed (downgrading to version 1.0, then back up to 1.4)?

  • Create a Gogs backup with gogs dump. This creates gogs-dump-[timestamp].zip file containing all important Gogs data.
  • Download the file matching the destination platform from the downloads page.
@charlesreid1 commented on GitHub (Feb 22, 2018): Documentation file needing updating is here: [from-gogs.en-us.md](https://github.com/go-gitea/gitea/blob/3ee8be384982260586454546c2b272daeceb1944/docs/content/doc/upgrade/from-gogs.en-us.md), also in French and Chinese ([dir](https://github.com/go-gitea/gitea/tree/3ee8be384982260586454546c2b272daeceb1944/docs/content/doc/upgrade)). @vityafx the first two instructions are probably the ones that need updating. Did gogs still generate `gogs-dump-[timestamp].zip`? All: Does the second instruction need changing, or does it actually describe the process that was needed (downgrading to version 1.0, then back up to 1.4)? > - Create a Gogs backup with gogs dump. This creates gogs-dump-[timestamp].zip file containing all important Gogs data. > - Download the file matching the destination platform from the downloads page.
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@appleboy 1.0.3 version :) Also, I still don't get what is gogs backup for? We don't use it later.

@iddm commented on GitHub (Feb 22, 2018): @appleboy 1.0.3 version :) Also, I still don't get what is `gogs backup` for? We don't use it later.
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@charlesreid1 I know neither french nor chinese :-D

@iddm commented on GitHub (Feb 22, 2018): @charlesreid1 I know neither french nor chinese :-D
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

@vityafx Can you help to update the document? Just only update English document.

@appleboy commented on GitHub (Feb 22, 2018): @vityafx Can you help to update the document? Just only update English document.
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

@appleboy Yes, I can. But I can only try doing that in english.

@iddm commented on GitHub (Feb 22, 2018): @appleboy Yes, I can. But I can only try doing that in english.
Author
Owner

@appleboy commented on GitHub (Feb 22, 2018):

@vityafx Great. Thank you. Waiting for your PR.

@appleboy commented on GitHub (Feb 22, 2018): @vityafx Great. Thank you. Waiting for your PR.
Author
Owner

@charlesreid1 commented on GitHub (Feb 22, 2018):

It would seem that gogs backup commands/options are not particularly well-documented. Not sure if this has been addressed but it doesn't look like it.

As far as how the backup (zip file) is used, that zip file will contain a copy of all checked out repositories, as well as a database of data (mysql or sqlite format, in a .db file). That's the file you specify in the config file line:

PATH = /home/:USER/gitea/data/:DATABASE.db
@charlesreid1 commented on GitHub (Feb 22, 2018): It would seem that [gogs backup commands/options are not particularly well-documented](https://github.com/gogits/gogs/issues/2924). Not sure if this has been addressed but it doesn't look like it. As far as how the backup (zip file) is used, that zip file will contain a copy of all checked out repositories, as well as a database of data (mysql or sqlite format, in a .db file). That's the file you specify in the config file line: ``` PATH = /home/:USER/gitea/data/:DATABASE.db ```
Author
Owner

@charlesreid1 commented on GitHub (Feb 22, 2018):

Some useful info about this topic at this issue on the same topic: #3487

@charlesreid1 commented on GitHub (Feb 22, 2018): Some useful info about this topic at this issue on the same topic: #3487
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

Review my PR please. I think I added everything what is necessary.

@iddm commented on GitHub (Feb 22, 2018): Review my PR please. I think I added everything what is necessary.
Author
Owner

@charlesreid1 commented on GitHub (Feb 22, 2018):

You made your PR against the master branch of your own repo - you should make it against the master branch of the gitea repo!

@charlesreid1 commented on GitHub (Feb 22, 2018): You made your PR against the master branch of your own repo - you should make it against the master branch of the gitea repo!
Author
Owner

@iddm commented on GitHub (Feb 22, 2018):

Oh, lol, that github annoys me.

@iddm commented on GitHub (Feb 22, 2018): Oh, lol, that `github` annoys me.
Author
Owner

@nubenum commented on GitHub (Mar 12, 2018):

Great. I was able to successfully migrate with these explanations.

However, the "Upgrading to most recent gitea version" section was inserted at the wrong place (the config changes below belong to the section above). Apart from that, I am not sure why one is supposed to first start gitea once and only then adapt the repositories path and the config. I might create another pull request if somebody can clear that up.

I am using Docker. The paths and the procedure for the migration with Docker are slightly different, but I think it's not absolutely necessary to explain it in more detail, this could be left "as an exercise for the reader" :)

EDIT: I'm facing problems similar to gogits/gogs#1916. The default git hooks try to invoke the old gogs executable. Resyncing the hooks didn't help. There are two files in the {pre,post}-receive.d directories, gitea (correct) and *-receive (wrong). Maybe that is the reason why it is recommended to restart gitea twice during migration? Or it's because I was using a newer version of gogs than 0.9.146. (Remedy: find gitea-repositories -path \*-receive.d/\*-receive -delete)

@nubenum commented on GitHub (Mar 12, 2018): Great. I was able to successfully migrate with these explanations. However, the "Upgrading to most recent gitea version" section was inserted at the wrong place (the config changes below belong to the section above). Apart from that, I am not sure why one is supposed to first start gitea once and only then adapt the repositories path and the config. I might create another pull request if somebody can clear that up. I am using Docker. The paths and the procedure for the migration with Docker are slightly different, but I think it's not absolutely necessary to explain it in more detail, this could be left "as an exercise for the reader" :) EDIT: I'm facing problems similar to gogits/gogs#1916. The default git hooks try to invoke the old gogs executable. Resyncing the hooks didn't help. There are two files in the `{pre,post}-receive.d` directories, `gitea` (correct) and `*-receive` (wrong). Maybe that is the reason why it is recommended to restart gitea twice during migration? Or it's because I was using a newer version of gogs than 0.9.146. (Remedy: `find gitea-repositories -path \*-receive.d/\*-receive -delete`)
Author
Owner

@steliosmilidonis commented on GitHub (Apr 25, 2018):

what version of gogs where you on @vityafx ?

@steliosmilidonis commented on GitHub (Apr 25, 2018): what version of gogs where you on @vityafx ?
Author
Owner

@iddm commented on GitHub (Apr 25, 2018):

I am on 1.4 now, why?

@iddm commented on GitHub (Apr 25, 2018): I am on 1.4 now, why?
Author
Owner

@MegaphoneJon commented on GitHub (Jun 20, 2018):

@steliosmilidonis and others looking to migrate from gogs to gitea in 2018 - I posted some notes at #4286 about my successful migration from the latest gogs.

@MegaphoneJon commented on GitHub (Jun 20, 2018): @steliosmilidonis and others looking to migrate from gogs to gitea in 2018 - I posted some notes at #4286 about my successful migration from the latest gogs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1554