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.
You want this: Upgrade from Gogs
Thank you very much!
@charlesreid1 The manual is a bit outdated:
gogs dump
anymore but gogs backup
. It must be run under non-root user.I have this error during gitea web
:
Failed to initialize ORM engine: migrate: do migrate: Error 1146: Table 'gogs.repo_unit' doesn't exist
@vityafx What is your gitea version?
@appleboy
$ ./gitea-bin --version
Gitea version 1.4.0+rc1-12-g423c642 built with: bindata, sqlite
@vityafx I think you should try the v1.0
version. download from https://dl.gitea.io/gitea/
@appleboy why so old?
You should migrate gogs to gitea v1.0 and then upgrade gitea from v1.0 to v1.4
@appleboy this also should be mentioned in the docs then.
@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.
@vityafx Nice, we should update the document.
@vityafx which version do you download? v1.0.x
?
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.
@appleboy 1.0.3 version :) Also, I still don't get what is gogs backup
for? We don't use it later.
@charlesreid1 I know neither french nor chinese :-D
@vityafx Can you help to update the document? Just only update English document.
@appleboy Yes, I can. But I can only try doing that in english.
@vityafx Great. Thank you. Waiting for your PR.
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
Some useful info about this topic at this issue on the same topic: #3487
Review my PR please. I think I added everything what is necessary.
You made your PR against the master branch of your own repo - you should make it against the master branch of the gitea repo!
Oh, lol, that github
annoys me.
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
)
what version of gogs where you on @vityafx ?
I am on 1.4 now, why?
@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.
Most helpful comment
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
)