Professional Documents
Culture Documents
Initializing A New Odoo Database: To Remove A Database You No Longer Need (Or Want To Recreate), Use The Command
Initializing A New Odoo Database: To Remove A Database You No Longer Need (Or Want To Recreate), Use The Command
Initializing A New Odoo Database: To Remove A Database You No Longer Need (Or Want To Recreate), Use The Command
$ ~/odoo-dev/odoo/./odoo-bin -d testdb
Managing Odoo databases
Although the Odoo server automatically takes care of that, we can manually create PostgreSQL databases from the
command line, using:
$ createdb MyDB
To list the existing databases in your system, use the PostgreSQL psql utility with the -l option:
$ Psql –l
To remove a database you no longer need (or want to recreate), use the dropdb command:
$ dropdb MyDB2
Odoo server configuration files
On a clean install, the .odoorc configuration file is not automatically created. We should use the --save option to
create the default configuration file, if it doesn't exist yet, and store the current instance configuration into it:
$ ~/odoo-dev/odoo/odoo-bin --http-port=8070
Run the following command on the second terminal:
$ ~/odoo-dev/odoo/odoo-bin --http-port=8071
There you go, two Odoo instances on the same server listening on different ports! The two instances can
use the same or different databases, depending on the configuration parameters used. And the two
could be running the same or different versions of Odoo.
The best practices say that our code should be kept in its own directory, and never mixed up with
Odoo's original code. So, to host our custom modules we will use a new directory alongside Odoo:
~/odoo-dev/custom-addons
Odoo includes a scaffold command to automatically create a new module
directory, with a basic structure already in place. You can learn more about it
with the following command:
$ ~/odoo-dev/odoo/odoo-bin scaffold –help