Gitea: cannot restore after server migration

Created on 22 May 2018  路  2Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.4
  • Git version: 2.7.4
  • Operating system: Ubuntu
  • Database (use [x]):

    • [ ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [x] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [x] Not relevant

  • Log gist:

Description

I followed these steps from the docs as I had to change my VPS provider.

During the restore process, the difficulty is with SQLite. Doing:
sqlite3 $DATABASE_PATH <gitea-db.sql
gives hundreds of errors, such as
Error: near line 1412: no such column: false Error: near line 1459: no such column: true Error: near line 1460: no such column: true Error: near line 1468: no such column: false Error: near line 1469: no such column: false
The previous server had the same git and gitea versions.

Any suggestion would be greatly appreciated.

kinquestion

Most helpful comment

I also face this problem and I fix it by converting in all INSERT statements false/true (booleans don't exist in SQLite by the way) to 0/1 before restoring to SQLite with the following _sed_ command :

sed -i -r '/INSERT INTO.*, (true|false)/ { s/true/1/g ; s/false/0/g }' gitea-db.sql

I hope it will help you.

All 2 comments

I have this same problem but gitea versions are different and the new gitea is running under docker.

I also face this problem and I fix it by converting in all INSERT statements false/true (booleans don't exist in SQLite by the way) to 0/1 before restoring to SQLite with the following _sed_ command :

sed -i -r '/INSERT INTO.*, (true|false)/ { s/true/1/g ; s/false/0/g }' gitea-db.sql

I hope it will help you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lunny picture lunny  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments

jakimfett picture jakimfett  路  3Comments

ghost picture ghost  路  3Comments

internalfx picture internalfx  路  3Comments