# Error Restore/Migration from gogs to gitea

**URL:** <https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052>\
**Category:** General\
**Created:** [April 3, 2019, 9:11am UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052 "2019-04-03T09:11:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christoph1972](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@Christoph1972](https://forum.gitea.com/u/Christoph1972)\
**Post date:** [April 3, 2019, 9:11am UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/1 "2019-04-03T09:11:14Z")

</div>

Hello Gitea users,

I am quite new in Git and services like gogs and gitea. Last summer I started to work with git and gogs on Windows with SQL-Server as database. Everything runs pretty good und I was happy about the integration of Git in my Visual Studio. Now I have the situation that my PC with the Git installation doesn’t work any longer. I have backups of my repositories the backups are created with ‘`gogs backup`’. Know I have the problem I can’t restore my backup.

I described my problem in the Gogs Forum, but there comes no help.

> **[View links from discuss.gogs.io · gogs/gogs · Discussion #6863](https://github.com/gogs/gogs/discussions/6863)**
>
> I am not clever enough to migrate and maintain such a complicated software that was used to run discuss.gogs.io, so I've broke it. Use Wayback Machine, e.g. https://web.archive.org/web/201805210838...

Now my hope is that a restore/migration by using gitea could be a solution!

I studied this this document:

> **[Upgrade from Gogs | Gitea Documentation](https://docs.gitea.io/en-us/upgrade-from-gogs/)**
>
> Gogs, version 0.9.146 and older, can be easily migrated to Gitea.

I executed all steps. When I run ‘gitea web’ the service starts but without my repositories. In the console appears the following error:

`Clean up repository temporary data [data\tmp]: exec: "cmd": executable file not found in %!P(MISSING)ATH%!(NOVERB)`

Is that the reason for the missing repositories?

What can I do?

I look forward to getting some helpful advices! At now I have the taste to lose the versioning of all my projects.

Kind regards  
Christoph

---

<div class="post-metadata">

**Author:** ![Christoph1972](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@Christoph1972](https://forum.gitea.com/u/Christoph1972)\
**Post date:** [April 4, 2019, 7:58am UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/2 "2019-04-04T07:58:28Z")

</div>

I am going ahead! I migrated all my repositories one by one per web gui. Gitea runs and offers my repositories as expected. I can download projects and work with them, commits are untested till now.

Now I like to upgrade gitea from 1.0.x to the recent version. Gitea 1.8/1.7 starts and shout down after a couple of seconds, without any information.

 ![Down](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/1X/cb427eaa03c0fa52cf6ab0531e0ba187f49aac76.jpeg)  
How to upgrade properly from 1.0.x to the recent version?

Kind regards  
Christoph

---

<div class="post-metadata">

**Author:** ![chk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/chk/32/476_2.png) [@chk](https://forum.gitea.com/u/chk)\
**Post date:** [April 4, 2019, 2:06pm UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/3 "2019-04-04T14:06:36Z")

</div>

standard disclaimer: I’m a noob and likely don’t know what I’m talking about. Take what I post with a grain of salt.

That said, I’ve read through your post at gogs and your post here, and am starting to strongly suspect that you might have a problem with your server rather than gogs or gitea (especially if you still have issues even after migrating by hand). Sudden inexplicable shutdowns tend to be good indicators of broader issues with your system.

Have you run diagnostics on your hardware (especially ram)? Are you in a position to reinstall your os?

Also, does gitea manage to write anything at all to the log before crashing?

---

<div class="post-metadata">

**Author:** ![Christoph1972](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@Christoph1972](https://forum.gitea.com/u/Christoph1972)\
**Post date:** [April 5, 2019, 6:56am UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/4 "2019-04-05T06:56:36Z")

</div>

Thanks a lot for your reply!

I cannot reinstall windows. I don’t belief in problems with the hardware, the machine is brand new, there are no other indicates for problems, all other stuff runs fine.

I added the logfile in the spoiler below:

> **Expand to see the logfile**
>
> 2019/04/04 08:45:05 [I] Log Mode: File(Info)  
> 2019/04/04 08:45:05 [I] XORM Log Mode: File(Info)  
> 2019/04/04 08:45:05 [I] Cache Service Enabled  
> 2019/04/04 08:45:05 [I] Session Service Enabled  
> 2019/04/04 08:45:05 [I] Beginning ORM engine initialization.  
> 2019/04/04 08:45:05 [I] ORM engine initialization attempt #1/10…  
> 2019/04/04 08:45:05 [I] Migration: create user column allow create organization  
> 2019/04/04 08:45:05 [I] Migration: create repo unit table and add units for all repos  
> 2019/04/04 08:45:05 [I] Migration: set protect branches updated with created  
> 2019/04/04 08:45:06 [I] Migration: add external login user  
> 2019/04/04 08:45:06 [I] Migration: generate and migrate Git hooks  
> 2019/04/04 08:45:06 [I] Migration: use new avatar path name for security reason  
> 2019/04/04 08:45:06 [I] Migration: rewrite authorized\_keys file via new format  
> 2019/04/04 08:45:06 [I] Migration: generate and migrate wiki Git hooks  
> 2019/04/04 08:45:06 [I] Migration: add user openid table  
> 2019/04/04 08:45:06 [I] Migration: change the key\_id and primary\_key\_id type  
> 2019/04/04 08:45:06 [I] Migration: add show field in user openid table  
> 2019/04/04 08:45:06 [I] Migration: generate and migrate repo and wiki Git hooks  
> 2019/04/04 08:45:06 [I] Migration: change mirror interval from hours to time.Duration  
> 2019/04/04 08:45:06 [I] Migration: add field for repo size  
> 2019/04/04 08:45:06 [I] This migration could take up to minutes, please be patient.  
> 2019/04/04 08:45:06 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:06 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:06 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:06 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:06 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:06 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:07 [I] Migration: add commit status table  
> 2019/04/04 08:45:08 [I] Migration: add primary key to external login user  
> 2019/04/04 08:45:08 [I] Migration: add field for login source synchronization  
> 2019/04/04 08:45:08 [I] Migration: add units for team  
> 2019/04/04 08:45:08 [I] Migration: remove columns from action  
> 2019/04/04 08:45:08 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:08 [I] Migration: give all units to owner teams  
> 2019/04/04 08:45:08 [I] Migration: adds comment to an action  
> 2019/04/04 08:45:08 [I] Migration: regenerate git hooks  
> 2019/04/04 08:45:08 [I] Migration: unescape user full names  
> 2019/04/04 08:45:08 [I] Migration: remove commits and settings unit types  
> 2019/04/04 08:45:08 [I] Migration: add tags to releases and sync existing repositories  
> 2019/04/04 08:45:08 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:08 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:08 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:08 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:08 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:08 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 08:45:09 [I] Migration: fix protected branch can push value to false  
> 2019/04/04 08:45:10 [I] Migration: remove duplicate unit types  
> 2019/04/04 08:45:10 [I] Migration: empty step  
> 2019/04/04 08:45:10 [I] Migration: empty step  
> 2019/04/04 08:45:10 [I] Migration: empty step  
> 2019/04/04 08:45:10 [I] Migration: remove index column from repo\_unit table  
> 2019/04/04 08:45:10 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:10 [I] Migration: remove organization watch repositories  
> 2019/04/04 08:45:10 [I] Migration: add deleted branches  
> 2019/04/04 08:45:10 [I] Migration: add repo indexer status  
> 2019/04/04 08:45:10 [I] Migration: adds time tracking and stopwatches  
> 2019/04/04 08:45:10 [I] Migration: migrate protected branch struct  
> 2019/04/04 08:45:10 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:10 [I] Migration: add default value to user prohibit\_login  
> 2019/04/04 08:45:10 [I] Migration: add lfs lock table  
> 2019/04/04 08:45:10 [I] Migration: add reactions  
> 2019/04/04 08:45:10 [I] Migration: add pull request options  
> 2019/04/04 08:45:10 [I] Migration: add writable deploy keys  
> 2019/04/04 08:45:10 [I] Migration: remove is\_owner, num\_teams columns from org\_user  
> 2019/04/04 08:45:10 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:10 [I] Migration: add closed\_unix column for issues  
> 2019/04/04 08:45:10 [I] Migration: add label descriptions  
> 2019/04/04 08:45:10 [I] Migration: add merge whitelist for protected branches  
> 2019/04/04 08:45:10 [I] Migration: add is\_fsck\_enabled column for repos  
> 2019/04/04 08:45:10 [I] Migration: add size column for attachments  
> 2019/04/04 08:45:10 [I] Migration: add last used passcode column for TOTP  
> 2019/04/04 08:45:10 [I] Migration: add language column for user setting  
> 2019/04/04 08:45:10 [I] Migration: add multiple assignees  
> 2019/04/04 08:45:11 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:11 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:11 [I] Migration: add u2f  
> 2019/04/04 08:45:11 [I] Migration: add login source id column for public\_key table  
> 2019/04/04 08:45:11 [I] Migration: remove stale watches  
> 2019/04/04 08:45:11 [I] Migration: Reformat and remove incorrect topics  
> 2019/04/04 08:45:11 [I] This migration could take up to minutes, please be patient.  
> 2019/04/04 08:45:11 [I] Validating existed topics…  
> 2019/04/04 08:45:11 [I] Deleting incorrect topics…  
> 2019/04/04 08:45:11 [I] Deleting ‘repo\_topic’ rows for topics with ids = []  
> 2019/04/04 08:45:11 [I] Deleting topics with id = []  
> 2019/04/04 08:45:11 [I] Checking the number of topics in the repositories…  
> 2019/04/04 08:45:11 [I] Deleting superfluous topics for repositories (more than 25 topics)…  
> 2019/04/04 08:45:11 [I] Updating repositories ‘topics’ fields…  
> 2019/04/04 08:45:11 [I] Migration: move team units to team\_unit table  
> 2019/04/04 08:45:11 [W] Unable to drop columns in SQLite  
> 2019/04/04 08:45:11 [I] Migration: add issue\_dependencies  
> 2019/04/04 08:45:11 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:11 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:14 [I] ORM engine initialization attempt #2/10…  
> 2019/04/04 08:45:14 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:14 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:17 [I] ORM engine initialization attempt #3/10…  
> 2019/04/04 08:45:17 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:17 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:20 [I] ORM engine initialization attempt #4/10…  
> 2019/04/04 08:45:20 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:20 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:23 [I] ORM engine initialization attempt #5/10…  
> 2019/04/04 08:45:23 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:23 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:26 [I] ORM engine initialization attempt #6/10…  
> 2019/04/04 08:45:26 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:26 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:29 [I] ORM engine initialization attempt #7/10…  
> 2019/04/04 08:45:29 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:29 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:32 [I] ORM engine initialization attempt #8/10…  
> 2019/04/04 08:45:32 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:32 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:35 [I] ORM engine initialization attempt #9/10…  
> 2019/04/04 08:45:35 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:35 [I] Backing off for 3 seconds  
> 2019/04/04 08:45:38 [I] ORM engine initialization attempt #10/10…  
> 2019/04/04 08:45:38 [I] Migration: protect each scratch token  
> 2019/04/04 08:45:38 […itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/04 08:47:05 [I] Log Mode: File(Info)  
> 2019/04/04 08:47:05 [I] XORM Log Mode: File(Info)  
> 2019/04/04 08:47:05 [I] Cache Service Enabled  
> 2019/04/04 08:47:05 [I] Session Service Enabled  
> 2019/04/04 08:47:05 [I] Beginning ORM engine initialization.  
> 2019/04/04 08:47:05 [I] ORM engine initialization attempt #1/10…  
> 2019/04/04 08:47:05 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:05 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:08 [I] ORM engine initialization attempt #2/10…  
> 2019/04/04 08:47:08 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:08 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:11 [I] ORM engine initialization attempt #3/10…  
> 2019/04/04 08:47:11 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:12 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:15 [I] ORM engine initialization attempt #4/10…  
> 2019/04/04 08:47:15 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:15 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:18 [I] ORM engine initialization attempt #5/10…  
> 2019/04/04 08:47:18 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:18 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:21 [I] ORM engine initialization attempt #6/10…  
> 2019/04/04 08:47:21 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:21 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:24 [I] ORM engine initialization attempt #7/10…  
> 2019/04/04 08:47:24 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:24 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:27 [I] ORM engine initialization attempt #8/10…  
> 2019/04/04 08:47:27 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:27 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:30 [I] ORM engine initialization attempt #9/10…  
> 2019/04/04 08:47:30 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:30 [I] Backing off for 3 seconds  
> 2019/04/04 08:47:33 [I] ORM engine initialization attempt #10/10…  
> 2019/04/04 08:47:33 [I] Migration: protect each scratch token  
> 2019/04/04 08:47:33 […itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/04 08:52:56 [I] Log Mode: File(Info)  
> 2019/04/04 08:52:56 [I] XORM Log Mode: File(Info)  
> 2019/04/04 08:52:56 [I] Cache Service Enabled  
> 2019/04/04 08:52:56 [I] Session Service Enabled  
> 2019/04/04 08:52:56 [I] Migration: protect each scratch token  
> 2019/04/04 08:52:56 […itea/routers/init.go:61 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/04 08:53:17 [I] Log Mode: File(Info)  
> 2019/04/04 08:53:17 [I] XORM Log Mode: File(Info)  
> 2019/04/04 08:53:17 [I] Cache Service Enabled  
> 2019/04/04 08:53:17 [I] Session Service Enabled  
> 2019/04/04 08:53:17 [I] Migration: protect each scratch token  
> 2019/04/04 08:53:17 […itea/routers/init.go:61 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/04 08:53:31 [I] Log Mode: File(Info)  
> 2019/04/04 08:53:31 [I] XORM Log Mode: File(Info)  
> 2019/04/04 08:53:31 [I] Cache Service Enabled  
> 2019/04/04 08:53:31 [I] Session Service Enabled  
> 2019/04/04 08:53:31 [I] Migration: protect each scratch token  
> 2019/04/04 08:53:31 […itea/routers/init.go:61 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/04 09:44:38 [I] Log Mode: File(Info)  
> 2019/04/04 09:44:38 [I] XORM Log Mode: File(Info)  
> 2019/04/04 09:44:38 [I] Cache Service Enabled  
> 2019/04/04 09:44:38 [I] Session Service Enabled  
> 2019/04/04 09:44:38 [I] Beginning ORM engine initialization.  
> 2019/04/04 09:44:38 [I] ORM engine initialization attempt #1/10…  
> 2019/04/04 09:44:38 [I] Migration: create user column allow create organization  
> 2019/04/04 09:44:38 [I] Migration: create repo unit table and add units for all repos  
> 2019/04/04 09:44:38 [I] Migration: set protect branches updated with created  
> 2019/04/04 09:44:38 [I] Migration: add external login user  
> 2019/04/04 09:44:38 [I] Migration: generate and migrate Git hooks  
> 2019/04/04 09:44:38 [I] Migration: use new avatar path name for security reason  
> 2019/04/04 09:44:38 [I] Migration: rewrite authorized\_keys file via new format  
> 2019/04/04 09:44:38 [I] Migration: generate and migrate wiki Git hooks  
> 2019/04/04 09:44:38 [I] Migration: add user openid table  
> 2019/04/04 09:44:38 [I] Migration: change the key\_id and primary\_key\_id type  
> 2019/04/04 09:44:38 [I] Migration: add show field in user openid table  
> 2019/04/04 09:44:38 [I] Migration: generate and migrate repo and wiki Git hooks  
> 2019/04/04 09:44:39 [I] Migration: change mirror interval from hours to time.Duration  
> 2019/04/04 09:44:39 [I] Migration: add field for repo size  
> 2019/04/04 09:44:39 [I] This migration could take up to minutes, please be patient.  
> 2019/04/04 09:44:40 [W] GetRepoSize: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 09:44:41 [I] Migration: add commit status table  
> 2019/04/04 09:44:41 [I] Migration: add primary key to external login user  
> 2019/04/04 09:44:41 [I] Migration: add field for login source synchronization  
> 2019/04/04 09:44:41 [I] Migration: add units for team  
> 2019/04/04 09:44:41 [I] Migration: remove columns from action  
> 2019/04/04 09:44:41 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:41 [I] Migration: give all units to owner teams  
> 2019/04/04 09:44:41 [I] Migration: adds comment to an action  
> 2019/04/04 09:44:41 [I] Migration: regenerate git hooks  
> 2019/04/04 09:44:41 [I] Migration: unescape user full names  
> 2019/04/04 09:44:41 [I] Migration: remove commits and settings unit types  
> 2019/04/04 09:44:41 [I] Migration: add tags to releases and sync existing repositories  
> 2019/04/04 09:44:42 [W] SyncReleasesWithTags: GetTags: exit status 128 - fatal: not a git repository (or any of the parent directories): .git
> 
> 2019/04/04 09:44:43 [I] Migration: fix protected branch can push value to false  
> 2019/04/04 09:44:43 [I] Migration: remove duplicate unit types  
> 2019/04/04 09:44:43 [I] Migration: empty step  
> 2019/04/04 09:44:43 [I] Migration: empty step  
> 2019/04/04 09:44:43 [I] Migration: empty step  
> 2019/04/04 09:44:43 [I] Migration: remove index column from repo\_unit table  
> 2019/04/04 09:44:43 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:43 [I] Migration: remove organization watch repositories  
> 2019/04/04 09:44:43 [I] Migration: add deleted branches  
> 2019/04/04 09:44:43 [I] Migration: add repo indexer status  
> 2019/04/04 09:44:43 [I] Migration: adds time tracking and stopwatches  
> 2019/04/04 09:44:43 [I] Migration: migrate protected branch struct  
> 2019/04/04 09:44:43 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:43 [I] Migration: add default value to user prohibit\_login  
> 2019/04/04 09:44:43 [I] Migration: add lfs lock table  
> 2019/04/04 09:44:43 [I] Migration: add reactions  
> 2019/04/04 09:44:43 [I] Migration: add pull request options  
> 2019/04/04 09:44:43 [I] Migration: add writable deploy keys  
> 2019/04/04 09:44:43 [I] Migration: remove is\_owner, num\_teams columns from org\_user  
> 2019/04/04 09:44:43 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:43 [I] Migration: add closed\_unix column for issues  
> 2019/04/04 09:44:43 [I] Migration: add label descriptions  
> 2019/04/04 09:44:43 [I] Migration: add merge whitelist for protected branches  
> 2019/04/04 09:44:43 [I] Migration: add is\_fsck\_enabled column for repos  
> 2019/04/04 09:44:43 [I] Migration: add size column for attachments  
> 2019/04/04 09:44:43 [I] Migration: add last used passcode column for TOTP  
> 2019/04/04 09:44:43 [I] Migration: add language column for user setting  
> 2019/04/04 09:44:43 [I] Migration: add multiple assignees  
> 2019/04/04 09:44:43 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:43 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:43 [I] Migration: add u2f  
> 2019/04/04 09:44:43 [I] Migration: add login source id column for public\_key table  
> 2019/04/04 09:44:43 [I] Migration: remove stale watches  
> 2019/04/04 09:44:43 [I] Migration: Reformat and remove incorrect topics  
> 2019/04/04 09:44:43 [I] This migration could take up to minutes, please be patient.  
> 2019/04/04 09:44:43 [I] Validating existed topics…  
> 2019/04/04 09:44:43 [I] Deleting incorrect topics…  
> 2019/04/04 09:44:43 [I] Deleting ‘repo\_topic’ rows for topics with ids = []  
> 2019/04/04 09:44:43 [I] Deleting topics with id = []  
> 2019/04/04 09:44:43 [I] Checking the number of topics in the repositories…  
> 2019/04/04 09:44:43 [I] Deleting superfluous topics for repositories (more than 25 topics)…  
> 2019/04/04 09:44:43 [I] Updating repositories ‘topics’ fields…  
> 2019/04/04 09:44:43 [I] Migration: move team units to team\_unit table  
> 2019/04/04 09:44:43 [W] Unable to drop columns in SQLite  
> 2019/04/04 09:44:43 [I] Migration: add issue\_dependencies  
> 2019/04/04 09:44:43 [I] Migration: protect each scratch token  
> 2019/04/04 09:44:44 [I] Backing off for 3 seconds  
> 2019/04/04 09:44:47 [I] ORM engine initialization attempt #2/10…  
> 2019/04/04 09:44:47 [I] Migration: protect each scratch token  
> 2019/04/04 09:44:47 [I] Backing off for 3 seconds  
> 2019/04/04 09:44:50 [I] ORM engine initialization attempt #3/10…  
> 2019/04/04 09:44:50 [I] Migration: protect each scratch token  
> 2019/04/04 09:44:50 [I] Backing off for 3 seconds  
> 2019/04/04 09:44:53 [I] ORM engine initialization attempt #4/10…  
> 2019/04/04 09:44:53 [I] Migration: protect each scratch token  
> 2019/04/04 09:44:53 [I] Backing off for 3 seconds  
> 2019/04/04 09:44:56 [I] ORM engine initialization attempt #5/10…  
> 2019/04/04 09:44:56 [I] Migration: protect each scratch token  
> 2019/04/04 09:44:56 [I] Backing off for 3 seconds  
> 2019/04/04 09:44:59 [I] ORM engine initialization attempt #6/10…  
> 2019/04/04 09:44:59 [I] Migration: protect each scratch token  
> 2019/04/04 09:44:59 [I] Backing off for 3 seconds  
> 2019/04/04 09:45:02 [I] ORM engine initialization attempt #7/10…  
> 2019/04/04 09:45:02 [I] Migration: protect each scratch token  
> 2019/04/04 09:45:02 [I] Backing off for 3 seconds  
> 2019/04/04 09:45:05 [I] ORM engine initialization attempt #8/10…  
> 2019/04/04 09:45:05 [I] Migration: protect each scratch token  
> 2019/04/04 09:45:05 [I] Backing off for 3 seconds  
> 2019/04/04 09:45:08 [I] ORM engine initialization attempt #9/10…  
> 2019/04/04 09:45:08 [I] Migration: protect each scratch token  
> 2019/04/04 09:45:08 [I] Backing off for 3 seconds  
> 2019/04/04 09:45:11 [I] ORM engine initialization attempt #10/10…  
> 2019/04/04 09:45:11 [I] Migration: protect each scratch token  
> 2019/04/04 09:45:11 […itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/04 09:49:33 [I] Log Mode: File(Info)  
> 2019/04/04 09:49:33 [I] XORM Log Mode: File(Info)  
> 2019/04/04 09:49:33 [I] Cache Service Enabled  
> 2019/04/04 09:49:33 [I] Session Service Enabled  
> 2019/04/04 09:49:33 [I] Beginning ORM engine initialization.  
> 2019/04/04 09:49:33 [I] ORM engine initialization attempt #1/10…  
> 2019/04/04 09:49:33 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:33 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:36 [I] ORM engine initialization attempt #2/10…  
> 2019/04/04 09:49:36 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:36 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:39 [I] ORM engine initialization attempt #3/10…  
> 2019/04/04 09:49:39 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:39 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:42 [I] ORM engine initialization attempt #4/10…  
> 2019/04/04 09:49:42 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:43 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:46 [I] ORM engine initialization attempt #5/10…  
> 2019/04/04 09:49:46 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:46 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:49 [I] ORM engine initialization attempt #6/10…  
> 2019/04/04 09:49:49 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:49 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:52 [I] ORM engine initialization attempt #7/10…  
> 2019/04/04 09:49:52 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:52 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:55 [I] ORM engine initialization attempt #8/10…  
> 2019/04/04 09:49:55 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:55 [I] Backing off for 3 seconds  
> 2019/04/04 09:49:58 [I] ORM engine initialization attempt #9/10…  
> 2019/04/04 09:49:58 [I] Migration: protect each scratch token  
> 2019/04/04 09:49:58 [I] Backing off for 3 seconds  
> 2019/04/04 09:50:01 [I] ORM engine initialization attempt #10/10…  
> 2019/04/04 09:50:01 [I] Migration: protect each scratch token  
> 2019/04/04 09:50:01 […itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column  
> 2019/04/05 08:35:35 [I] Log Mode: File(Info)  
> 2019/04/05 08:35:35 [I] XORM Log Mode: File(Info)  
> 2019/04/05 08:35:35 [I] Cache Service Enabled  
> 2019/04/05 08:35:35 [I] Session Service Enabled  
> 2019/04/05 08:35:35 [I] Beginning ORM engine initialization.  
> 2019/04/05 08:35:35 [I] ORM engine initialization attempt #1/10…  
> 2019/04/05 08:35:35 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:35 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:38 [I] ORM engine initialization attempt #2/10…  
> 2019/04/05 08:35:38 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:38 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:41 [I] ORM engine initialization attempt #3/10…  
> 2019/04/05 08:35:41 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:41 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:44 [I] ORM engine initialization attempt #4/10…  
> 2019/04/05 08:35:44 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:44 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:47 [I] ORM engine initialization attempt #5/10…  
> 2019/04/05 08:35:47 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:47 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:50 [I] ORM engine initialization attempt #6/10…  
> 2019/04/05 08:35:50 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:50 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:53 [I] ORM engine initialization attempt #7/10…  
> 2019/04/05 08:35:53 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:53 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:56 [I] ORM engine initialization attempt #8/10…  
> 2019/04/05 08:35:56 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:56 [I] Backing off for 3 seconds  
> 2019/04/05 08:35:59 [I] ORM engine initialization attempt #9/10…  
> 2019/04/05 08:35:59 [I] Migration: protect each scratch token  
> 2019/04/05 08:35:59 [I] Backing off for 3 seconds  
> 2019/04/05 08:36:02 [I] ORM engine initialization attempt #10/10…  
> 2019/04/05 08:36:02 [I] Migration: protect each scratch token  
> 2019/04/05 08:36:02 […itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: Sync2: Cannot add a PRIMARY KEY column

Thanks a lot for the support!  
Kind regards  
Christoph

---

<div class="post-metadata">

**Author:** ![chk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/chk/32/476_2.png) [@chk](https://forum.gitea.com/u/chk)\
**Post date:** [April 5, 2019, 9:32am UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/5 "2019-04-05T09:32:31Z")

</div>

Many users have reported issues when upgrading gitea using the sqlite3 backend. See for example: [Upgrade gitea 1.6 to 1.7 problem](https://forum.gitea.com/t/upgrade-gitea-1-6-to-1-7-problem/946/23). Perhaps your issues and these issues stem from the same underlying reason? (i.e. a bug in gitea’s sqlite3 code)

Either way, the log seems to indicate database trouble or at least inconsistency.

Also note that 1.8 is a release candidate and not an official release yet. The change logs for 1.8 list breaking changes that may or may not play a role in the migration’s failure.

What I would do is to:

1. download 1.6.x or even 1.5.x, and see if migration succeeds from 1.0.x, or
2. download every major release (1.1, 1.2, 1.3, 1.4, 1.5, 1.6, and 1.7). and run them at least once in order so that the database is incrementally updated, or
3. wait for a more knowledgeable member of this forum to weigh in with their knowledge.

I hesitate to suggest option 4 (redo manual migration by hand). Depending on the amount of data you need to migrate. I doubt you’re willing to redo all that tedious work all over again.

If you’re not particularly attached to gitea, have you looked at gitlab? I’ve been evaluating them for a couple of days and they offer a very compelling feature set if you can ignore their shortcomings. They support automatic [migration](https://docs.gitlab.com/ee/user/project/import/gitea.html) from your gitea instance and their update process is as simple and atomic as gitea’s if you use docker images. The only issue is that you’ll need to use a VM since you use windows.

---

<div class="post-metadata">

**Author:** ![shoo](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@shoo](https://forum.gitea.com/u/shoo)\
**Post date:** [April 9, 2019, 12:46pm UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/6 "2019-04-09T12:46:51Z")

</div>

> [@chk](#):
>
> download every major release (1.1, 1.2, 1.3, 1.4, 1.5, 1.6, and 1.7). and run them at least once in order so that the database is incrementally updated, or

This is what I had to do when I had problems, took a while but it worked in the end.

---

<div class="post-metadata">

**Author:** ![chk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/chk/32/476_2.png) [@chk](https://forum.gitea.com/u/chk)\
**Post date:** [April 9, 2019, 2:05pm UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/7 "2019-04-09T14:05:36Z")

</div>

Another option is to open an issue on gitea’s github. Rereading op’s description, I think that placing the issue in front of the developers’ eyes might be more appropriate than posting it here given the nature of this issue.

---

<div class="post-metadata">

**Author:** ![Christoph1972](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@Christoph1972](https://forum.gitea.com/u/Christoph1972)\
**Post date:** [April 9, 2019, 2:32pm UTC](https://forum.gitea.com/t/error-restore-migration-from-gogs-to-gitea/1052/8 "2019-04-09T14:32:59Z")

</div>

Hello!

Thanks a lot for the reply’s! My solution was (just some minutes ago!) to migrate by using http migration, not from the local files! I did it like shown here:

Finally I have to try backup und restore via gitea. I found this document:

[https://docs.gitea.io/en-us/backup-and-restore/](https://docs.gitea.io/en-us/backup-and-restore/)

But where is the description for a restore workflow?

Kind regards  
Christoph
