Knowledgebase

Question About Servers
We are aware of a potentially service impacting issue. Learn more

How to Change an Odoo Database Name Print

  • 0

In Odoo, changing the database name directly from the interface isn't a standard feature. However, you can rename a database using the command line. Here’s how you can do it:

Step 1: Stop the Odoo service.

Before making any changes, ensure the Odoo server is stopped to avoid any data corruption.

sudo service odoo stop

Step 2: Rename the Database.

Use the `pg_rename` command to rename the PostgreSQL database.

sudo -u postgres psql -c "ALTER DATABASE old_database_name RENAME TO new_database_name;"
Replace `old_database_name` with the current name of your database and `new_database_name` with the desired new name.

Step 3: Update the Odoo Configuration File.

If you have specified the database name in the Odoo configuration file (`odoo.conf`), update it to reflect the new database name.

sudo nano /etc/odoo/odoo.conf
Look for the `db_name` parameter and update it:

db_name = new_database_name

Step 4: Restart the Odoo Server.

After renaming the database and updating the configuration, restart the Odoo server.

sudo service odoo start

Additional Considerations:

  • Backup: Always take a backup of your database before making any changes.
  • Database User Permissions: Ensure the PostgreSQL user has the necessary permissions to rename the database.
  • Custom Modules: If you have custom modules or configurations that reference the database name, you may need to update those as well.

By following these steps, you can successfully rename your Odoo database.


Was this answer helpful?

« Back

Enterprise-Grade Hardware

  • Samsung
  • Juniper
  • Western Digital
  • Supermicro
  • LSI
  • Intel
  • R1Soft Backups
  • cPanel
  • MySQL
  • Parallels
  • HP Partner