Initializing A New Odoo Database: To Remove A Database You No Longer Need (Or Want To Recreate), Use The Command

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Initializing a new Odoo database

$ ~/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 --save --stop-after-init


Changing the listening port
Let's try this out. Open two terminal windows. On the first, run this:

$ ~/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.

Creating the module's basic skeleton


The Odoo server code at ~/odoodev/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

$~/odoo-dev/odoo/odoo-bin scaffold <mymodules> <custom-addons path>

Upgrade or Update module:


$ ./odoo-bin -d todo -u todo_app

You might also like