# \[SOLVED\] Upgrade gitea 1.6 to 1.7 problem

**URL:** <https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946>\
**Category:** Install/Maintain/Configure\
**Created:** [February 18, 2019, 12:56pm UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946 "2019-02-18T12:56:20Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![sysadminmatmoz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/sysadminmatmoz/32/4804_2.png) [@sysadminmatmoz](https://forum.gitea.com/u/sysadminmatmoz)\
**Post date:** [April 3, 2019, 5:25am UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/21 "2019-04-03T05:25:16Z")

</div>

It’s quite similar to what my file was like (except it was dumped from postgres), isn’t it lunny? 🙂

I have no clue about the reason of the problem, but I would bet that there’s a new (mandatory) column in the \> 1.7 that wasn’t there in the 1.6 (just a wild guess).

---

<div class="post-metadata">

**Author:** ![Mageti](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/mageti/32/466_2.png) [@Mageti](https://forum.gitea.com/u/Mageti)\
**Post date:** [April 3, 2019, 7:38am UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/22 "2019-04-03T07:38:42Z")

</div>

To me, the problem seems more like a variable type conversion failing.  
And my guess would be on the `config` field. You can see at the beginning of my dump that empty variables are stored as `{}`, and at the end of the dump, they are stored ad `NULL`.  
I would also guess that `{}` values were stored using gitea version\<1.6, as I started using gitea several years ago, and that `NULL` values are stored using gitea version==1.6.  
But all that are only guesses.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [April 12, 2019, 1:45am UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/23 "2019-04-12T01:45:23Z")

</div>

> [@Mageti](#):
>
> {“AllowMerge”:1

should be  
{“AllowMerge”:true

don’t know why it changed.

---

<div class="post-metadata">

**Author:** ![Mageti](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/mageti/32/466_2.png) [@Mageti](https://forum.gitea.com/u/Mageti)\
**Post date:** [April 12, 2019, 8:41am UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/24 "2019-04-12T08:41:12Z")

</div>

> [@lunny](#):
>
> should be  
> {“AllowMerge”:true
> 
> don’t know why it changed.

Good catch ! 👍

Unfortunately, I am not sure it can be corrected with a simple SQL query, since it’s a json field inside the SQL row. ☹

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [April 15, 2019, 6:07pm UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/25 "2019-04-15T18:07:21Z")

</div>

I don’t know sqlite command off top of my head but in mysql it would be:

```auto
UPDATE repo_unit SET config = replace(config, '"AllowMerge":1', '"AllowMerge":true');

```

And as a sidenote as postgresql has native json operations it would be much easier than using a find and replace such as above.

---

<div class="post-metadata">

**Author:** ![Mageti](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/mageti/32/466_2.png) [@Mageti](https://forum.gitea.com/u/Mageti)\
**Post date:** [April 16, 2019, 8:25am UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/26 "2019-04-16T08:25:44Z")

</div>

Here is what I have done on my sqlite database:

```auto
UPDATE repo_unit SET config = replace(config, '"AllowMerge":1', '"AllowMerge":true');
UPDATE repo_unit SET config = replace(config, '"AllowRebase":1', '"AllowRebase":true');
UPDATE repo_unit SET config = replace(config, '"AllowSquash":1', '"AllowSquash":true');

```

just to be sure the other fields do not end up with the same error.

Now, I am able to start gitea in latest version (1.7.x) without error.  
Many thanks for the help !

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [April 16, 2019, 6:30pm UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/27 "2019-04-16T18:30:36Z")

</div>

@Mageti this is fantastic news!

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [May 7, 2019, 12:34am UTC](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946/28 "2019-05-07T00:34:45Z")

</div>



[Previous page](https://forum.gitea.com/t/solved-upgrade-gitea-1-6-to-1-7-problem/946.md?page=1)
