# Migration 5.4 \> 5.6, sqldump import

**URL:** https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184
**Category:** System Administrator
**Created:** [September 4, 2020, 12:12pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184 "2020-09-04T12:12:05Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 4, 2020, 12:12pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/1 "2020-09-04T12:12:05Z")

</div>

Because I moved my system to a new version, I did a fresh install of docker and tryton and thus accidentially ended up with trytond 5.6.5.

Then I imported my 5.4 sqldump and tried to log in at the web client, which shows this error:

```auto
Traceback (most recent call last):
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 109, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 48, in rpc
    request, database_name, *requestrpc_params)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 63, in login
    database_name, user, parameters, context=context)
  File "/usr/local/lib/python37/dist-packages/trytond/securitypy", line 50, in login
    session = user_id, Sessionnew()
  File "/usr/local/lib/python37/dist-packages/trytond/ir/sessionpy", line 51, in new
    session, = clscreate([values])
  File "/usr/local/lib/python37/dist-packages/trytond/ir/sessionpy", line 149, in create
    return super(Session, cls)create(vlist)
  File "/usr/local/lib/python37/dist-packages/trytond/model/modelsqlpy", line 159, in wrapper
    return func(cls, *args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/model/modelsqlpy", line 676, in create
    clstrigger_create(records)
  File "/usr/local/lib/python37/dist-packages/trytond/model/modelstoragepy", line 76, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/model/modelstoragepy", line 166, in trigger_create
    triggers = Triggerget_triggers(cls __name__ , 'create')
  File "/usr/local/lib/python37/dist-packages/trytond/ir/triggerpy", line 178, in get_triggers
    ('on_%s' % mode, '=', True),
  File "/usr/local/lib/python37/dist-packages/trytond/model/modelsqlpy", line 1317, in search
    cursorexecute(*select)
  File "/usr/local/lib/python37/dist-packages/trytond/backend/postgresql/databasepy", line 69, in execute
    cursorexecute(self, sql, args)
psycopg2ProgrammingError: column aaction does not exist
LINE 1: SELECT "a""id" AS "id", "a""action" AS "action", "a""acti
                                 ^
HINT: Perhaps you meant to reference the column "aactive"

```

My guess is that comes from the different versions. I read @pokoli’s hints on migration 5.4 \> 5.6, but could not understand it. What shall I do?

Cheers,  
Wolf

PS: Thanks for making the quote look reasonable. I ever wanted to know how to do that… Lesson learned… (:

---

<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: [September 4, 2020, 12:55pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/2 "2020-09-04T12:55:24Z")

</div>

When updating to a new series, you must [perform a database update](https://docs.tryton.org/projects/server/en/latest/topics/setup_database.html#update-a-database). But also check if there are any manual task to do from [Migration — Tryton Documentation](https://discuss.tryton.org/c/migration/6).

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 4, 2020, 7:23pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/3 "2020-09-04T19:23:01Z")

</div>

Thank you, Cédric. About database update with this command:  
`trytond-admin -c <config file> -d <database name> --all`

- How does it work with docker?
- Do I need to perform that with the tryton-postgres only - or with tryton as well?
- Which config file is meant ?

Thanks a lot in advace,  
Wolf

---

<div class="post-metadata">

### Author: ![johnny](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@johnny](https://discuss.tryton.org/u/johnny)
#### Post date: [September 4, 2020, 11:42pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/4 "2020-09-04T23:42:31Z")

</div>

Abend Wolf,

> [@herrdeh](#):
>
> How does it work with docker?

```bash
docker run \
    --link tryton-postgres:postgres \
    -e DB_PASSWORD=mysecretpassword \
    -it tryton/tryton \
    --rm \
    trytond-admin -c $TRYTON_CONFIG -d tryton --all

```

In the Docker Container we have the environment variable `$TRYTON_CONFIG` which contains the path (`/etc/trytond.conf`) to the config file.  
If you want to see what’s in your config file you can start a bash-Session inside your running container with the following command:

```bash
docker exec -it tryton bash

```

Then you can see it’s contents with `cat $TRYTOND_CONFIG`

> [@herrdeh](#):
>
> Do I need to perform that with the tryton-postgres only - or with tryton as well?

The tryton-container contains only the code, while the data is stored in the database. So you execute the script from the tryton-container, which – as far as I understand it – modifies the data in the tryton-postgres-container.

> [@herrdeh](#):
>
> Which config file is meant ?

The config file is described in the official [documentation](https://docs.tryton.org/projects/server/en/latest/topics/configuration.html).

Hope I could help you.

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 7, 2020, 5:41pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/5 "2020-09-07T17:41:01Z")

</div>

> [@johnny](#):
>
> ```auto
> docker run \
> --link tryton-postgres:postgres \
> -e DB_PASSWORD=mysecretpassword \
> -it tryton/tryton \
> --rm \
> trytond-admin -c $TRYTON_CONFIG -d tryton --all
> 
> ```

I put all above into one long line an got this error:

```
[uWSGI] getting INI configuration from /etc/uwsgi.conf
uwsgi: unrecognized option '--rm'
getopt_long() error

```

---

<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: [September 7, 2020, 8:11pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/6 "2020-09-07T20:11:48Z")

</div>

Arguments passed after the image name are passed to the entrypoint of the image.  
Here `--rm` is a docker run option to remove container at the end so it should be before the image name:

```auto
$ docker run \
    --link tryton-postgres:postgres \
    -e DB_PASSWORD=mysecretpassword \
    --rm \
    -it tryton/tryton \
    trytond-admin -c $TRYTON_CONFIG -d tryton --all

```

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 8, 2020, 1:18am UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/7 "2020-09-08T01:18:18Z")

</div>

Thank you very much. This is what I get:

```
$ sudo docker run --link tryton-postgres:postgres -e DB_PASSWORD=[mysecretpassword] --rm -it tryton/tryton trytond-admin -c $TRYTON_CONFIG -d tryton --all

```

[sudo] Passwort für [user]:  
usage: trytond-admin [-h] [–version] [-c FILE [FILE …]] [-v] [–dev]  
[-d DATABASE [DATABASE …]] [–logconf FILE]  
[-u MODULE [MODULE …]] [–all]  
[–activate-dependencies] [–email EMAIL] [-p]  
[–reset-password] [-m] [-l CODE [CODE …]]  
[–hostname HOSTNAME]  
trytond-admin: error: argument -c/–config: expected at least one argument

---

<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: [September 8, 2020, 7:05am UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/8 "2020-09-08T07:05:29Z")

</div>

`-c $TRYTON_CONFIG` is evaluated outside the docker container so it is missing.  
But indeed I think you do not need it at all because the entrypoint.sh will set it.

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 8, 2020, 11:03am UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/9 "2020-09-08T11:03:36Z")

</div>

Thank you Cédric. Next try is this one:

```auto
$ sudo docker run --link tryton-postgres:postgres -e DB_PASSWORD=[mysecretpw] -it tryton/tryton trytond-admin -d tryton --all
could not load tryton,himBHsd
Traceback (most recent call last):
  File "/usr/local/bin/trytond-admin", line 21, in <module>
admin.run(options)
  File "/usr/local/lib/python3.7/dist-packages/trytond/admin.py", line 20, in run
Database = backend.get('Database')
  File "/usr/local/lib/python3.7/dist-packages/trytond/backend/ __init__.py", line 22, in get
db_type = name()
  File "/usr/local/lib/python3.7/dist-packages/trytond/backend/ __init__.py", line 18, in name
config.get('database', 'uri', default='')).scheme
  File "/usr/lib/python3.7/urllib/parse.py", line 368, in urlparse
splitresult = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib/python3.7/urllib/parse.py", line 459, in urlsplit
raise ValueError("Invalid IPv6 URL")
ValueError: Invalid IPv6 URL

```

---

<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: [September 8, 2020, 11:23am UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/10 "2020-09-08T11:23:24Z")

</div>

It seems you have left the `-c` option.

---

<div class="post-metadata">

### Author: ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)
#### Post date: [September 9, 2020, 9:09pm UTC](https://discuss.tryton.org/t/migration-5-4-5-6-sqldump-import/3184/11 "2020-09-09T21:09:12Z")

</div>

> [@herrdeh](#):
>
> ```auto
> sudo docker run --link tryton-postgres:postgres -e DB_PASSWORD=[mysecretpw] -it tryton/tryton trytond-admin -d tryton --all
> 
> ```

In fact, I messed up copy and paste. ):  
With the command above (no -c option, as I understood msg #7), the process finished. But I’m not yet sure whether it actually worked, I described the problem after import [HERE.](https://discuss.tryton.org/t/migration-update-problem-new-ssd/3197)
