Odoo Database Basics: From Creation to Backup and Tools
Welcome! In this article, we’ll walk you through the basics of working with Odoo databases — from creating new databases to managing backups, and even setting things up with Docker and tools like DBeaver. Let’s dive in! 🚀🗄️
🆕 Creating a New Database in Odoo
Odoo allows you to create a new database easily, whether you're using the web interface or working directly from the terminal.
🌐 Method 1: Using the Web Interface
1. Open Odoo in your browser, e.g., http://localhost:8069;
2. Click on "Manage Databases" (usually under the login form) or use link:
localhost:8069/web/database/selector
3. Then click "Create Database";
4. Fill out the form:
Master Password: This is the admin password defined in odoo.conf under admin_passwd.
Database Name: Choose a name (no spaces or special characters).
Email & Password: For the admin user of your new DB.
Optionally, select demo data if you want to explore Odoo with sample content.
5. Click Create Database 🟢
💻 Method 2: Using the Command Line
Prefer using the terminal? Here’s how to create a new database via command line:
./odoo-bin -d your_db_name --db_user=odoo --db_password=odoo -i base
Explanation:
-d your_db_name — name of the new database.
--db_user=odoo / --db_password=odoo — credentials for connecting to Postgres.
-i base — install the base module to initialize the DB.
If your PostgreSQL is running on a non-default port (not 5432), you can tell Odoo to connect to it like this:
./odoo-bin -d your_db_name --db_host=localhost --db_port=5433 --db_user=odoo --db_password=odoo -i base
Explanation:
--db_host=localhost
The address of the machine where your PostgreSQL server is running. If it’s on the same computer as Odoo, use localhost;--db_port=5433
The port PostgreSQL is listening on. Use this if your PostgreSQL is configured to run on a port other than 5432;
📦 Dumping and Restoring Databases
Sometimes you want to back up your Odoo database. Here's how you can dump (export) and restore (import) a database.
🧰 Dumping (Backing Up) Your Database
You can do this in two main ways:
Go to http://localhost:8069/web/database/manager;
Click on "Backup";
Enter your Master Password;
Choose if you want to include filestore;
Click Backup.