Doctor required migrate, after migration the model version is too high to start gitea again. #7481

Closed
opened 2025-11-02 07:26:57 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @Silberling on GitHub (Jun 19, 2021).

Description

I just migrated from latest gogs 0.12.3 to gitea 1.0.2 -> 1.14.3 as documented here: (https://docs.gitea.io/en-us/upgrade-from-gogs/) - hopefully correct.

I got a bunch of warnings documented here: (https://docs.gitea.io/en-us/command-line/#doctor-recreate-table)

When running gitea doctor recreate-table It asked me to run gitea migrate first as model version 185 is required

2021/06/19 02:09:11 main.go:117:main() [F] Failed to run app with [./gitea --config /data/gitea/conf/app.ini doctor recreate-table]: migrate: Current database version 178 is
 not equal to the expected version 185. Please run "gitea [--config /path/to/app.ini] migrate" to update the database version

After running migrate and then doctor recreate-table and then starting the container again I get

2021/06/19 02:10:49 ...ations/migrations.go:388:Migrate() [F] Downgrading database version from '185' to '178' is not supported and may result in loss of data integrity.
        If you really know what you're doing, execute `UPDATE version SET version=178 WHERE id=1;

Disclaimer:

I'm not sure how well the migration from gogs to gitea went.

I want to provide them here if more context is required what happened.

After migration Gitea started and threw the workings (number 1), Everything in the Web UI looked fine. Pull worked. When pushing I got an error (number 2). I decided to run gitea doctor recreate-table.

The two problems I just want to mention here to provide more context:

  • A bunch Warnings like this:
2021/06/19 02:09:17 ...om/urfave/cli/app.go:524:HandleAction() [W] Table task has column start_time but struct has not related field

-> Reason why I wanted to run gitea doctor recreate-table

  • Unable to push because commit hooks weren't fixed after running gitea admin regenerate hooks

-> Might become a separate issue

Originally created by @Silberling on GitHub (Jun 19, 2021). - Gitea version (or commit ref): 1.14.3 - Git version: - Operating system: debian rpi4 docker gitea/gitea:1.14.3 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: https://gist.github.com/Silberling/c7deffa72f7cffe18f646f633e87a0fe ## Description I just migrated from latest gogs 0.12.3 to gitea 1.0.2 -> 1.14.3 as documented here: (https://docs.gitea.io/en-us/upgrade-from-gogs/) - hopefully correct. I got a bunch of warnings documented here: (https://docs.gitea.io/en-us/command-line/#doctor-recreate-table) When running ```gitea doctor recreate-table``` It asked me to run gitea migrate first as model version 185 is required ``` 2021/06/19 02:09:11 main.go:117:main() [F] Failed to run app with [./gitea --config /data/gitea/conf/app.ini doctor recreate-table]: migrate: Current database version 178 is not equal to the expected version 185. Please run "gitea [--config /path/to/app.ini] migrate" to update the database version ``` After running ```migrate``` and then ```doctor recreate-table``` and then starting the container again I get ``` 2021/06/19 02:10:49 ...ations/migrations.go:388:Migrate() [F] Downgrading database version from '185' to '178' is not supported and may result in loss of data integrity. If you really know what you're doing, execute `UPDATE version SET version=178 WHERE id=1; ``` Disclaimer: I'm not sure how well the migration from gogs to gitea went. I want to provide them here if more context is required what happened. After migration Gitea started and threw the workings (number 1), Everything in the Web UI looked fine. Pull worked. When pushing I got an error (number 2). I decided to run ```gitea doctor recreate-table```. The two problems I just want to mention here to provide more context: - A bunch Warnings like this: ``` 2021/06/19 02:09:17 ...om/urfave/cli/app.go:524:HandleAction() [W] Table task has column start_time but struct has not related field ``` -> Reason why I wanted to run ```gitea doctor recreate-table``` - Unable to push because commit hooks weren't fixed after running ```gitea admin regenerate hooks``` -> Might become a separate issue
Author
Owner

@techknowlogick commented on GitHub (Jun 19, 2021):

version 185 means when you ran migrate you weren't using the binary that was inside the docker container, but instead you were using a development version of the binary.

@techknowlogick commented on GitHub (Jun 19, 2021): `version 185` means when you ran migrate you weren't using the binary that was inside the docker container, but instead you were using a development version of the binary.
Author
Owner

@Silberling commented on GitHub (Jun 19, 2021):

version 185 means when you ran migrate you weren't using the binary that was inside the docker container, but instead you were using a development version of the binary.

I did docker exec -it gitea /bin/bash on a container running gitea/gitea:1.14.3 when executing gitea. This is the version supplied from docker hub in a freshly downloaded image without any modification.

@Silberling commented on GitHub (Jun 19, 2021): > `version 185` means when you ran migrate you weren't using the binary that was inside the docker container, but instead you were using a development version of the binary. I did ```docker exec -it gitea /bin/bash``` on a container running ```gitea/gitea:1.14.3``` when executing gitea. This is the version supplied from docker hub in a freshly downloaded image without any modification.
Author
Owner

@Silberling commented on GitHub (Jun 19, 2021):

Correction: I ran docker run -it --rm -u root --network=thecontainernetworktohavednsformysql -v gitea_data:/data gitea/gitea /bin/bash

@Silberling commented on GitHub (Jun 19, 2021): Correction: I ran ```docker run -it --rm -u root --network=thecontainernetworktohavednsformysql -v gitea_data:/data gitea/gitea /bin/bash```
Author
Owner

@Silberling commented on GitHub (Jun 19, 2021):

I just checked if :latest and :1.14.3 are the same.
They are not.
In my mind I thought :latest is always pointing to the latest production release, not to a development release.
Explicitly using :1.14.3 in the command above worked.

@Silberling commented on GitHub (Jun 19, 2021): I just checked if :latest and :1.14.3 are the same. They are not. In my mind I thought :latest is always pointing to the latest production release, not to a development release. Explicitly using :1.14.3 in the command above worked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7481