Skip to Content
Menu
This question has been flagged
3 Replies
4286 Views

We are evaluating using Odoo and I am trying to duplicate a database created using the install process. I am looking at Odoo from the perspective of a database admin and Linux admin so managing the database, including things like cloning and backups are important to me. And right now, I want to set up a new instance with a database cloned from one that has already had some data loaded so we can test out some things without affecting the initial database.

My procedure is this:

1. Duplicate the existing database.

 - I have done this using Manage Databases -> Duplicate and I have also done it using pg_dump with the same results.

2. Create a new config file, altering these settings for the new database:

  - db_name

  - http_port

  - logfile

  - longpolling_port

  - pidfile

I have separate systemd service scripts for each instance so after the duplicate completes, I start the service for the duplicated database. I use the -c directive to specify a non-default path for the config file. I am using the same Odoo install directory for both instances.

When I open the URL for the duplicated instance in a browser, the login page is all messed up. Instead of everything being centered in the web page, it's all crammed into the left side of the page, the fonts are different, and the login button has what I would call default decoration. I can log in and it knows if I give a bad password, but the page that comes up after I login is almost completely blank and nothing useful can be done. Everything is crammed into the upper left corner again, and it only has the Odoo logo, "Edit Company data" which is a hot link but clicking on it just brings you back to the same page. And there is also "Powered by Odoo" which links to www.odoo.com.

I have an on-premise install from source of version 11 community on Centos 7 using updated versions of Python and PostgreSQL from the software collection repository. Everything works fine on the fresh install database, and if I drop the duplicated database, create it new, then run odoo-bin in initialization mode on the new database, start the systemd service script, then I have an instance that looks and operates normally.

Can someone please tell me what I am doing wrong?

Thanks for any help.

Linus
Avatar
Discard
Best Answer

An Odoo 'database' isn't just persisted in PostgreSQL - it also has a filestore which can be found in the .local folder of the user who is configured to own the server process.

Odoo generates backed web assets (i.e. compiles .less, minifies .js etc), saves these in the filestore, and references to these files are saved in the ir_attachment-table.  This is also where user uploaded attachments and the contents of some binary fields are stored by default.

/home/ODOO_USER/.local/share/Odoo/filestore/DB_NAME

SOUNDS LIKE the filestore is missing or corrupt.


Does adding ?debug= to the URL change anything (this forces Odoo not to use the pregenerated assets) ?

yourodoo.com/web?debug=
Avatar
Discard
Author Best Answer

That's good to know about the filestore, I wondered what was going on with that.

Unfortunately, that doesn't solve my problem, but now I am aware that I am getting a warning in the log. What is happening violates my understanding of the db_name parameter in the config file. The odoo-bin help message says "specify the database name" but that doesn't appear to be what is happening.

When I specify db_name = <mydb2> I expect it to connect to that database but that isn't what is happening so my understanding must be incorrect.

I get this error: WARNING ? odoo.http: Logged into database '<mydb1>', but dbfilter rejects it; logging session out.

I specified db_name = <mydb2> in the config file so why is it trying to connect to the wrong database?

But, it doesn't log that message if I kill odoo-bin and just start it again. Regardless of that, it still gives me the garbage web page. If I run the script to start <mydb1>, it gets the same warning the first time but works. I'ts like it remembers what database was connected to.

Thanks for your help.

Linus


Avatar
Discard
Best Answer

You do not tell what you want to achieve.

If you want to run multiple databases in the same instance (why do you want to run multiple instances on the same server?), then I do it the following way:

1. Backup your database using the database manager

2. Restore the database and give it a new name.

Use dbfilter to point to the proper database.

Avatar
Discard