Open tomwll opened 4 years ago
This should be a bug of xorm.
Well, sequences generated by gitea dump
are also off. The consequence is that you'll get duplicate key violations when adding new issues/labels/... in the migrated gitea instance.
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
[x]
):Description
The base scenario is to switch gitea from using sqlite as database to make it use PostgreSQL (PostrgreSQL 11.7 in this case, but should not matter). Result is that e. g. the user table is not being created, and thus users aren't being able to login into the "restored" postgresql instance.
One creates a gitea backup (original datbase store sqlite) with
Then extracts the dump
At this point a postgresql database named
gitea
exists onlocalhost
, along with a user able to access that database. Restoring the database dump yields messages like:One can "fix" the SQL dump by running the command
This would set proper bool defaults for Postgres. After that, importing the dump works correctly and without errors.
Example:
psql -U gitea < restore/gitea-db.sql