📂 Odoo Database Basics: From Creation to Backup and Tools
📂

​       ​​​​

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

This is the most beginner-friendly method and works right from your browser:

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.

💡

By default, Odoo connects to the PostgreSQL database using port 5432.

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;

⚠️

Can’t See or Access Databases?

If you're not seeing your database list in the browser or can't connect to a specific one, make sure your Odoo configuration file (odoo.conf) has the correct database settings:

db_name = False
list_db = True
  • db_name = False
    This allows Odoo to show all available databases instead of locking to a single one.

  • list_db = True
    Enables the "Manage Databases" link on the login screen, allowing you to see the list of databases, create new ones, or drop old ones.

📦 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:

Using the Odoo Web Interface
  1. Go to http://localhost:8069/web/database/manager;

  2. Click on "Backup";

  3. Enter your Master Password;

  4. Choose if you want to include filestore;

  5. Click Backup.