I installed a fresh Odoo and created a DataBase, installed all modules I need and made the admin an admin.
Now I want to duplicate this db, but I always get "Database is being accessed by other users".
How can I duplicate a database with the database manager GUI of odoo?
If I stop odoo service the simple line of sql does the job:
CREATE DATABASE whatever_db WITH TEMPLATE base_deb OWNER db_owner;
If it isn't possible without entering a console, what use does this function have at all?
This is due to postgres keeping track of the connections, even if they are not closed correctly (just killing the browser for example). Probably the thing to do is restart Odoo. Right after that, the connections should be gone and you should be able to duplicate.
For some mysterious reason it sometimes works over here after pressing the button multiple times. I am clueless as to why that is.
By the way, the client-dump of the database is not always fool-proof we have found out. I still rely on the pg_dump, if only to ensure the type of dump and the other options such as the no-owner flag. Furthermore, when using legacy postgres to update to a new postgres, the client will not do the job correctly.
That is a good question and I guess there's no answer for that, no answer like you want.
Like you want, only wait for Oddo disconnect from db and after you can do database operations.
After some time testing and using Odoo, I think the "database manager" feature needs more work.
I can only do database operations after use SQL query to postgresql disconnect any user from specific database which I'll work.
Here the query useful sometimes, to kill connections:
WHERE pg_stat_activity.datname = 'database_name'
AND pid <> pg_backend_pid();
Change 'database_name' for your needs and all connections to db will be closed.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 10/14/14, 7:43 AM|
|Seen: 1656 times|
|Last updated: 3/16/15, 8:10 AM|