Migration / update problem new SSD

Using the web client, when you connect to Tryton, what database is shown on the login screen where it asks for your user name, and is this read-only, or can you change which database to use?

Ahhh, crap … that’s the problem you are dumping ALL databases. That should not be happening. You have to use

$ sudo docker exec tryton-postgres pg_dump <your_database_name> > <your_backupname>.sql

So you are only dumping your database and nothing else.

The GUI says I’m connecting to “tryton-test” - which is the DB I set up in PIP.
When I try to use “postgres” or “template1”, it says that “ir_cache” does not exist.

This is how databases look at the source side:
Bildschirmfoto von 2020-09-14 13-53-39

Actually, there is a DB called “template1” Should I just throw that one out?

elbo’s dump command does this:

$ sudo docker exec tryton-postgres pg_dump postgres > dump-nur-postgres1409.sql
pg_dump: error: connection to database "postgres" failed: FATAL:  role "root" does not exist

Can you try:

$ sudo docker exec tryton-postgres pg_dump -U postgres postgres > dump-nur-postgres1409.sql

Or does pgAdmin not have a possiblity to backup your database?

I wouldn’t worry too much about it, it is a standard template database.

This one produced a 7MB file (good size…), readable etc.

Then I did:

  • start postgres

and

mymachine ~$  sudo psql -U postgres -d tryton_test -f 1409-dump-nur-postgres.sql 
    [sudo] Passwort für wd: 
    Password for user postgres: 
    SET
    SET
    SET
    SET
    SET
     set_config
------------
     
    (1 row)

    SET
    SET
    SET
    SET
    psql:1409-dump-nur-postgres.sql:28: ERROR:  relation "account_account_id_seq" already exists
    ALTER TABLE
    SET
    SET
    psql:1409-dump-nur-postgres.sql:66: ERROR:  relation "account_account" already exists
    ALTER TABLE
    COMMENT
    psql:1409-dump-nur-postgres.sql:87: ERROR:  relation "account_account_deferral_id_seq" already exists
    ALTER TABLE
    psql:1409-dump-nur-postgres.sql:108: ERROR:  relation "account_account_deferral" already exists

Carrying on to create lots of “already exists” errors. Looks as if the command does not overwrite existing entries…

Yeah I think you have to start from scratch again. Drop your tryton_test database and recreate it. Then import the dump.

I think you have to go even further back. You probably also have removed your newly created tryton user. So I would suggest to start Migration / update problem new SSD here.

  1. Create the new user
  2. Create the new database
  3. Read your dump file

Hm. Something must be wrong. I created a new database and a new role (should be the same as “user”). Tried the import as above - and end up with a billion of errors, very similar to those above.

How can we deal with that more efficiently?