Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from latest gogs (0.11.46.0418) is possible #4286

Open
MegaphoneJon opened this issue Jun 20, 2018 · 21 comments

Comments

@MegaphoneJon
Copy link

commented Jun 20, 2018

The gitea documentation says you must upgrade from 0.9.146 of gogs, but (at least anecdotally) I'm able to upgrade from the latest version as of this writing (0.11.46.0418). I may submit a PR to the docs after I've run this in production for a few weeks, but for now I want to write this up so others can find it if necessary.

  • Gitea version (or commit ref): 1.4.2+6-gcaee487 built with: bindata, sqlite
  • Git version: 2.15.2
  • Operating system: Alpine Linux 3.7.0
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I migrated from one Docker image to another.

In addition to the steps outlined in the Upgrade from gogs doc, I also had to change every instance of gogs in my conf/app.ini file to gitea. I also had to change my PATH (under [database]) to /data/gitea/data/gitea.db (the gogs container has symlinks from /app that gitea doesn't). Also my ROOT_PATH (under log) changed from /app/gogs/log to /data/gitea/log.

Once I did that, I had gitea 1.0.2 working. Two more changes I had to make owing to my newer gogs version:

  • I had to regenerate my .ssh/authorized_keys file (from the Web UI's admin panel). Failure to do this resulted in the following error:
bash: /app/gogs/gogs: No such file or directory                                                          
fatal: Could not read from remote repository.
  • gogs generated a bunch of git hooks that reference the gogs binary. You can delete them from the UI or the command line (see the find command at #3558 (comment)). If you don't delete them you'll receive the following error:
remote: ./hooks/pre-receive.d/pre-receive: line 2: /app/gogs/gogs: No such file or directory             
To ssh://git.example.com:10022/user/repo.git                                 
 ! [remote rejected]   master -> master (pre-receive hook declined) 

Finally - SSH push/pulls didn't work properly for me even after doing all these things until I upgraded to version 1.4. I couldn't upgrade directly - I assume this is related to #4424 - but I was able to go 1.0 » 11 » 1.2 » 1.3 » 1.4 painlessly. Once I was on 1.4 everything worked properly.

@lunny

This comment has been minimized.

Copy link
Member

commented Jun 21, 2018

Please feel free to send a PR

@MegaphoneJon

This comment has been minimized.

Copy link
Author

commented Jun 21, 2018

I'm going to wait until this has been in production for a while before submitting a PR. I didn't analyze the database structure between a fresh gitea db and my own, for instance.

@furai

This comment has been minimized.

Copy link

commented Jul 5, 2018

Have you run into any issues so far?

@MegaphoneJon

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

@furai No, I haven't. I feel pretty confident at this point in what I did, so I'll make a TODO for myself to submit a PR to the documentation.

@furai

This comment has been minimized.

Copy link

commented Jul 6, 2018

Did you compare the databases?

@MegaphoneJon

This comment has been minimized.

Copy link
Author

commented Jul 6, 2018

@furai I haven't - which is why I need to set aside some time for this task. I was a bit glib in suggesting I just needed to write up my docs.

@w-flo

This comment has been minimized.

Copy link

commented Jul 29, 2018

Thanks, this seems to have worked for me starting from gogs 0.11.56.x.
Obviously I don't know if there are any DB inconsistencies. The DB migration process printed a bunch of yellow warnings (?) while migrating gitea from 1.0 to latest via the different 1.x releases, but maybe that's expected.

@marcolivier

This comment has been minimized.

Copy link

commented Jul 30, 2018

Thanks for the instructions—it was a quick and easy transition from the latest version of Gogs to 1.0.2 and then slowly to 1.1, 1.2, 1.3, 1.4 and finally 1.5. I could've probably went straight to 1.5 but I wanted to play it safe.
I haven't encountered any problem yet but my DB was pretty small.

@furai

This comment has been minimized.

Copy link

commented Aug 1, 2018

I'm mostly interested whether PR and comments get migrated and all the settings for webhooks and git hooks. That's the most important thing for me.

@atom0s

This comment has been minimized.

Copy link

commented Aug 1, 2018

I just migrated personally and yes, they all migrated with it. The only thing that had a problem was Discord web hooks had to be manually fixed in the database. (Gogs marks them as ID 3, Gitea is 4. So a simple query fixes it.) My experience with moving to Gitea here: #4538

@furai

This comment has been minimized.

Copy link

commented Aug 1, 2018

That's good news. What secret are you talking about in your issue? What can it be used for? I'm trying to figure out if my users might have been relying on it.

@atom0s

This comment has been minimized.

Copy link

commented Aug 1, 2018

With the web hooks, there is a secret key that can be sent with the hooks request. On Gogs, this was more recently changed on how it was sent. It used to be sent as "secretkey" inside of the data (json blob) but was changed to be a header and was also changed to be a hash of the key vs. the raw key itself.

On Gitea, this is reverted back to the old setup of Gogs where its sent in the data and is the raw key.

@techknowlogick

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

On Gitea, this is reverted back

To be clear it was not reverted back, Gitea forked from Gogs at a certain point, and no developer contributed the code to Gitea that was contributed to Gogs. There is a ticket for this functionality to be added, however no developer has taken up the cause to add it to Gitea. Perhaps you could.

Edit: #3901 is the ticket I am referencing.

deoren added a commit to deoren/gitea that referenced this issue Aug 5, 2018

Update "Upgrade from Gogs" en-us doc
- Move "Change gogs specific information" FROM/TO steps up
  to just beneath matching section header, adjust indention
  and explicitly specify syntax of code sample to provide
  highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration (see below)

- Move "Upgrading to most recent ..." section down, remove
  decoration (section header formatting likely covers this
  well enough already)

refs go-gitea#4286, go-gitea#3558

deoren added a commit to deoren/gitea that referenced this issue Aug 5, 2018

Update "Upgrade from Gogs" fr-fr doc
- Adjust indention and explicitly specify syntax of code
  sample to provide highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration since
  section header formatting likely covers this
  well enough already

refs go-gitea#4286, go-gitea#3558

techknowlogick added a commit that referenced this issue Aug 25, 2018

Update en-us and fr-fr versions of the "Upgrade from Gogs" doc (#4618)
* Update "Upgrade from Gogs" en-us doc

- Move "Change gogs specific information" FROM/TO steps up
  to just beneath matching section header, adjust indention
  and explicitly specify syntax of code sample to provide
  highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration (see below)

- Move "Upgrading to most recent ..." section down, remove
  decoration (section header formatting likely covers this
  well enough already)

refs #4286, #3558

* Update "Upgrade from Gogs" fr-fr doc

- Adjust indention and explicitly specify syntax of code
  sample to provide highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration since
  section header formatting likely covers this
  well enough already

refs #4286, #3558

BetaCat0 added a commit to BetaCat0/gitea that referenced this issue Sep 3, 2018

Update en-us and fr-fr versions of the "Upgrade from Gogs" doc (go-gi…
…tea#4618)

* Update "Upgrade from Gogs" en-us doc

- Move "Change gogs specific information" FROM/TO steps up
  to just beneath matching section header, adjust indention
  and explicitly specify syntax of code sample to provide
  highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration (see below)

- Move "Upgrading to most recent ..." section down, remove
  decoration (section header formatting likely covers this
  well enough already)

refs go-gitea#4286, go-gitea#3558

* Update "Upgrade from Gogs" fr-fr doc

- Adjust indention and explicitly specify syntax of code
  sample to provide highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration since
  section header formatting likely covers this
  well enough already

refs go-gitea#4286, go-gitea#3558
@Obihoernchen

This comment has been minimized.

Copy link

commented Sep 29, 2018

Just upgraded latest Gogs 0.11.66 to Gitea 1.5.1 👍

I copied my gogs mysql database, followed https://docs.gitea.io/en-us/upgrade-from-gogs/, edited my app.ini and upgraded from 1.0.2 > 1.1.4 > 1.2.3 > 1.3.3 > 1.4.3 > 1.5.1. A direct upgrade from 1.02 to 1.5.1 failed, so I upgraded step by step.
Afterwards go to Admin panel and regenerate hooks, update ssh keys etc.

Edit: Have a look in gitea-repositories and search for gogs grep -R gogs. There might be some hook leftovers you have to delete.

So far everything seems to work as expected 👍

HoffmannP pushed a commit to HoffmannP/gitea that referenced this issue Nov 14, 2018

Update en-us and fr-fr versions of the "Upgrade from Gogs" doc (go-gi…
…tea#4618)

* Update "Upgrade from Gogs" en-us doc

- Move "Change gogs specific information" FROM/TO steps up
  to just beneath matching section header, adjust indention
  and explicitly specify syntax of code sample to provide
  highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration (see below)

- Move "Upgrading to most recent ..." section down, remove
  decoration (section header formatting likely covers this
  well enough already)

refs go-gitea#4286, go-gitea#3558

* Update "Upgrade from Gogs" fr-fr doc

- Adjust indention and explicitly specify syntax of code
  sample to provide highlighting

- Adjust header levels to match what appears to be the
  intended level, remove trailing decoration since
  section header formatting likely covers this
  well enough already

refs go-gitea#4286, go-gitea#3558
@stale

This comment has been minimized.

Copy link

commented Jan 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the stale label Jan 7, 2019

@nougad

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2019

I was able to directly update from gogs 0.11.79 (archlinux aur) to gitea 1.7.1 (archlinux community) with postgres.

Steps done:

  • Stop Gogs and backup everything
  • Downgrade database to older version update version set version = 13
  • Install gitea (reconfigure, change permission, change paths, ...)
  • Delete old git hooks: rm /var/lib/gitea/repo/*/*.git/hooks/post-receive.d/post-receive /var/lib/gitea/repo/*/*.git/hooks/pre-receive.d/pre-receive and execute Resynchronize pre-receive, update and post-receive hooks of all repositories. in gitea

Afterwards everything was working. While I would not necessarily recommend it, at least I want to mention that it's possible.

(ref: #5318)

@KuDeSnik33ra

This comment has been minimized.

Copy link

commented Feb 13, 2019

Where "update version set version = 13" should be executed?

@stale stale bot removed the stale label Feb 13, 2019

@lafriks

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

@KuDeSnik33ra in your database tools connected to Gitea database

@stale

This comment has been minimized.

Copy link

commented Apr 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the stale label Apr 14, 2019

@xFragger

This comment has been minimized.

Copy link

commented Apr 16, 2019

Migration itself worked fine from gogs 0.11, but all my users were ldap users (except one admin user) and they are not able to login anymore.
The users are there, all have the correct auth source, the ldap auth-settings itself are correct too, but i can't select the auth-method on the login page.

I'm using sqlite database and can't see any other errors in the log or any other place, any idea?

@stale stale bot removed the stale label Apr 16, 2019

@lafriks

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

You don't need to select auth method on login page. If you have configured and enabled auth source in login page users should authorize standard username/password login

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.