The restored database never appears in the Tryton login dropdown at all

Hi, I need help. After backing up my Tryton database on the server using:

pg_dump -U user1ad -d database_tryton > database_tryton.sql

I went to my localhost, created a virtual environment, and copied the server environment exactly. Then I created a new database:

CREATE DATABASE new_database;

After that, I restored the backup:

psql -U developer -d new_database < /home/developer/database_tryton.sql

The problem is that when I run:

trytond-admin -c trytond.conf -vv -d new_database --all

it executes without errors, but it does not ask me to enter the admin email or password (the usual initialization step). As a result, the database name new_database does not appear in the Tryton interface (SAO). Why is this happening, and what am I missing?

in trytond.conf , here is how I put the database section

[database]

uri = postgresql:///

Ps: I have already tried to create another virtualenv and install modules one by one and install sao same as in the server and then restore data before initialization but same thing happen i can not see the database in the trytond when I go to browser, the thing happen always when I restore data before initalization (trytond-admin -c trytond.conf -vv -d new_database --all -vv) as I say it doesn’t even ask me to enter password or email , it’s running silently

any help will be appreciated, Thank you

when you execute

trytond -c trytond.conf -d new_database

works for you?

after load modules it just show

126077 140165519484608 [2026-04-19 15:45:39,150] INFO trytond.pool setup mixin for “new_database”
126077 140165519484608 [2026-04-19 15:45:39,150] INFO trytond.modules all modules loaded
126077 140166021963840 [2026-04-19 15:45:39,268] INFO werkzeug * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit) and I go to http://0.0.0.0:8000/ and I can’t see the database

make sure that you add username password and host:

I have updated database section in trytond.conf

[database]

uri = postgresql://admin:secretpassword@localhost/

—>so then when I typed again trytond-admin -c trytond.conf -vv -d new_database --all

trytond.backend.postgresql.database connection to “new_database” succeeded
135347 139933203255360 [2026-04-19 17:52:32,309] INFO trytond.admin init db
Traceback (most recent call last):
File “/home/dev/.virtualenvs/trytond6/bin/trytond-admin”, line 23, in
admin.run(options)
File “/home/dev/.virtualenvs/trytond6/lib/python3.11/site-packages/trytond/admin.py”, line 31, in run
database.init()
File “/home/dev/.virtualenvs/trytond6/lib/python3.11/site-packages/trytond/backend/postgresql/database.py”, line 364, in init
cursor.execute(line)
File “/home/dev/.virtualenvs/trytond6/lib/python3.11/site-packages/trytond/backend/postgresql/database.py”, line 72, in execute
cursor.execute(self, sql, args)
psycopg2.errors.DuplicateTable: relation “ir_configuration_id_seq” already exists

----->I fixed this error via sql queries

ALTER DATABASE “new_database” OWNER TO admin;
ALTER SCHEMA public OWNER TO admin;
DO $$
DECLARE r RECORD;
BEGIN
FOR r IN SELECT tablename FROM pg_tables WHERE schemaname = ‘public’ LOOP
EXECUTE ‘ALTER TABLE public.’ || quote_ident(r.tablename) || ’ OWNER TO admin’;
END LOOP;
FOR r IN SELECT sequencename FROM pg_sequences WHERE schemaname = ‘public’ LOOP
EXECUTE ‘ALTER SEQUENCE public.’ || quote_ident(r.sequencename) || ’ OWNER TO admin’;
END LOOP;
END;
$$;

but then when I typed again trytond-admin -c trytond.conf -vv -d new_database --all( it doesn’t even ask me to enter email admin or password and confirm it again , the command running silently) and after go again to browser

I just see the database dropdown empty

I am guessing that you are trying to setup a local environment for some testing.

Just create the same username/password for PostgreSQL to simplify .
you are using username user1ad but in the localhost you are using developer.

those usernames are independent from trytond.

username in server is user1ad where I have did the backup via pg_dump -U user1ad -d database_tryton > database_tryton.sql

Name            |  Owner        |     Access privileges     

database_tryton | postgres      |=Tc/postgres postgres=CTc/postgres         ++++++++++++++++++++                user1=c/postgres

In my localhost I did the restore via psql -U developer -d new_database -W < /home/developer/database_tryton.sql

Name          |  Owner    |     Access privileges     

new_database  | developer |

in trytond.conf

[database]
uri = postgresql://developer:xxxxx@localhost:5432/
list = True

After trytond-admin -c trytond.conf -vv -d new_database --all
—>there is no database list in the trytond Interface

Ps: even when I tried to again create database and linked to owner postgres like in the server via CREATE DATABASE “new_database” OWNER postgres ENCODING ‘UTF8’ LC_COLLATE ‘en_US.UTF-8’ LC_CTYPE ‘en_US.UTF-8’ TEMPLATE template0;


>the same thing happen no database shown on the dropdown list login and when i run trytond-admin -c trytond.conf -vv -d new_database --all


>it doesnt show me the option to enter manually email for the admin or type the password and when I go to browser i can not see this database

Ensure that is the same owner that you have on your dump:



grep OWNER /home/developer/database_tryton.sql
1 Like

If you have setup an hostname in the ir.configuration, the database will only be visible for request to that same hostname.
If you do not want this filter anymore, you can just clear the value from the table.

1 Like

I tried to put the new_database have same owner name , but same behaviour happen

Thanks Mr.@ced , the solution was that I cleared hostname in ir.configuration via commad UPDATE ir_configuration SET hostname = NULL;

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