# Problem updating database from 6.8 to 7.0 (Docker)

**URL:** https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512
**Category:** System Administrator
**Created:** [August 2, 2024, 8:58pm UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512 "2024-08-02T20:58:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![trytoune](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/trytoune/32/2119_2.png) [@trytoune](https://discuss.tryton.org/u/trytoune)
#### Post date: [August 2, 2024, 8:58pm UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/1 "2024-08-02T20:58:44Z")

</div>

I tried to update my database using :

> `docker run --env DB_HOSTNAME=tryton_postgres --env DB_PASSWORD=XXXXXX --network tryton_network --interactive --tty --rm tryton/tryton trytond-admin -d tryton_database --all`

This error is returned :

> Traceback (most recent call last):  
> File “/usr/local/bin/trytond-admin”, line 33, in   
> admin.run(options)  
> File “/usr/local/lib/python3.11/dist-packages/trytond/admin.py”, line 57, in run  
> pool.init(update=options.update, lang=list(lang),  
> File “/usr/local/lib/python3.11/dist-packages/trytond/pool.py”, line 144, in init  
> restart = not load\_modules(  
> \_\_\_\_\_\_\_\_\_\_\_\_\_^^^^^^^^^^^^^  
> File “/usr/local/lib/python3.11/dist-packages/trytond/modules/ **init**.py”, line 396, in load\_modules  
> \_load\_modules(update)  
> File “/usr/local/lib/python3.11/dist-packages/trytond/modules/ **init**.py”, line 366, in \_load\_modules  
> load\_module\_graph(graph, pool, update, lang, indexes)  
> File “/usr/local/lib/python3.11/dist-packages/trytond/modules/ **init**.py”, line 198, in load\_module\_graph  
> cls. **register** (module)  
> File “/usr/local/lib/python3.11/dist-packages/trytond/model/fields/fmany2one.py”, line 29, in **register**  
> table\_h.add\_fk(  
> File “/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/table.py”, line 430, in add\_fk  
> cursor.execute(  
> File “/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py”, line 71, in execute  
> cursor.execute(self, sql, args)  
> psycopg2.errors.ForeignKeyViolation: insert or update on table “ir\_action\_report” violates foreign key constraint “ir\_action\_report\_model\_model\_fkey”  
> DETAIL: Key (model)=() is not present in table “ir\_model”.

Am I doing something wrong ?  
I think I must do these steps **after** the update and not before right ? [https://discuss.tryton.org/t/migration-from-6-8-to-7-0/6265](https://discuss.tryton.org/t/migration-from-6-8-to-7-0/6265)  
And the modules must be updated **after** these steps, right ?

Many thanks for what you do.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 2, 2024, 9:12pm UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/2 "2024-08-02T21:12:07Z")

</div>

This error can happen only because you are upgrading to the series 7.2 and not 7.0.  
In this case you must follow all the migration steps between 6.8 and 7.2.

---

<div class="post-metadata">

### Author: ![trytoune](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/trytoune/32/2119_2.png) [@trytoune](https://discuss.tryton.org/u/trytoune)
#### Post date: [August 2, 2024, 9:24pm UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/3 "2024-08-02T21:24:18Z")

</div>

Many thanks for your fast answer.  
It’s very nice.  
Here is the command I used to update :

> docker run --name tryton --env DB\_HOSTNAME=postgres --env DB\_PASSWORD=XXXXXX --mount source=tryton-data,target=/var/lib/trytond/db --network tryton\_network --publish 127.0.0.1:8000:8000 --detach tryton/tryton:7.0

It seems docker is using version 7.0

 ![tryton_7.0](https://discuss-cdn.tryton.org/uploads/default/original/2X/6/6e7e65c43bcdd92c2826ffcf885f38d091a371bd.png)

I downgraded temporarily to 6.8 to get my list of modules and it did not showed this error.  
I could connect normally.

EDIT :  
Do I have to update tryton-data too ?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 3, 2024, 6:59am UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/4 "2024-08-03T06:59:24Z")

</div>

> [@trytoune](#):
>
> Here is the command I used to update :
> 
> > docker run --name tryton --env DB\_HOSTNAME=postgres --env DB\_PASSWORD=XXXXXX --mount source=tryton-data,target=/var/lib/trytond/db --network tryton\_network --publish 127.0.0.1:8000:8000 --detach tryton/tryton:7.0

This does not launch `trytond-admin` update command.

> [@trytoune](#):
>
> Do I have to update tryton-data too ?

No the data structure does not change.

---

<div class="post-metadata">

### Author: ![trytoune](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/trytoune/32/2119_2.png) [@trytoune](https://discuss.tryton.org/u/trytoune)
#### Post date: [August 3, 2024, 12:34pm UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/5 "2024-08-03T12:34:34Z")

</div>

Thanks for your answer.  
What `trytond-admin` update command are you talking about please ?  
The one I put in the first post ? [Problem updating database from 6.8 to 7.0 (Docker)](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512)  
Or another one ?

You told me I used tryton 7.2.  
I showed I used the tag 7.0 to update the tryton container before trying to update the database.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 4, 2024, 8:21am UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/6 "2024-08-04T08:21:02Z")

</div>

> [@trytoune](#):
>
> What `trytond-admin` update command are you talking about please ?

> **[How to setup a database — Tryton server](https://docs.tryton.org/latest/server/topics/setup_database.html#update-a-database)**

> [@trytoune](#):
>
> You told me I used tryton 7.2.  
> I showed I used the tag 7.0 to update the tryton container before trying to update the database.

The first command you posted was not using the tag 7.0 so you actually run the `trytond-admin` command with the latest version which is 7.2.

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [August 6, 2024, 2:52am UTC](https://discuss.tryton.org/t/problem-updating-database-from-6-8-to-7-0-docker/7512/7 "2024-08-06T02:52:09Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
