Enable Dark Mode!
how-to-seamlessly-integrate-external-mysql-data-in-odoo-19.jpg
By: Sanjay P

How to Seamlessly Integrate External MySQL Data in Odoo 19

Odoo 19 Technical Odoo Enterprises Odoo Community

Current enterprise systems are never built using a single system. Odoo has been used as a central platform for business processes, but other legacy web applications, e-commerce sites, warehouse management systems, or custom websites built using an external MySQL database may still be used.

Manual export of CSV files or the use of brittle and custom Python scripts to extract transform and load data is cumbersome and inefficient. In Odoo 19, the MySQL connector plugin will allow you to build a seamless solution to connect external MySQL databases to Odoo and integrate the two in a simple and efficient manner.

In this practical guide, we will learn how to connect to MySQL, map a table schema, and synchronize the external data into Odoo 19.

Key Features Overview

  • Centralized Credentials Configuration: Manage secure configurations for connecting multiple hosts of MySQL in Odoo.
  • Automatic Schema Loading: Automatically fetch the schema of tables along with the fields in the remote/local MySQL database.
  • Field Mapping Capability: Direct mapping between custom MySQL fields and the corresponding Odoo standard/custom models (like res.partner for Contacts).
  • Foreign Key Processing: Feature of mapping foreign keys to corresponding columns in the related tables.
  • Import Logging & History: Logging of the imported data set along with the history of its statuses (Draft > Fetched > Synchronized).

For the purpose of demonstrating this application, a very basic MySQL database odoo_test with one table external_partners has been designed:

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

Step-by-Step Setup and Synchronization

Step 1: Access Credential Configuration

  • Open the Mysql Connector app from your Odoo 19 main menu.
  • Click Configuration > Credentials.

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

  • Click the New button to create a new MySQL host entry.

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

Step 2: Establish the Server Connection

1. Input your database server connection details:

  • Database: odoo_test
  • Host: localhost (or external IP)
  • Username: odoo
  • Password: odoo

2. Click the Connect button at the top left.

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

Upon successful authentication, the record status bar transitions to Connected.

Step 3: Define Table Mapping Rules

After establishing a connection between the two platforms, a mapping rule needs to be set up in order to instruct Odoo in which table to read data from and where to send it.

1. Navigate to Configuration > Connector.

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

2. Fill out the mapping definition fields:

  • Name: Sync External Partners
  • Connection: Select your established connection (odoo_test).
  • Mysql Table Name: Enter the exact MySQL table name (external_partners).
  • Odoo Table Name: Select the target Odoo model (Contact / res.partner).

3. Click the Fetch Data button.

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

Step 4: Map MySQL Columns to Odoo Fields

Once fetched, the module populates the Data Mapping table with detected column names from MySQL.

1. For each MySQL field, map its corresponding Odoo target field:

  • name > Name (Contact)
  • email > Email (Contact)
  • phone > Phone (Contact)
  • (Note: Leave non-relational scalar columns empty under Reference Table/Column).

2. Save the mapping configuration.

3. Click the Sync Table button.

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

The status stage in the upper-right corner updates from Fetched to Synced.

Step 5: Verify the Synchronized Data in Odoo

To confirm the data transfer, open Odoo's Contacts application:

1. Michael Brown and Sarah Parker now appear in the Contacts list view:

How to Seamlessly Integrate External MySQL Data in Odoo 19-cybrosys

Common Use Cases for Businesses

  • E-commerce Integration: Integrate customer records and sales transactions from MySQL-based e-commerce websites into Odoo Sales and Invoicing modules.
  • ERP Legacy Systems: Gradually move records to Odoo 19 from existing ERP systems using MySQL without causing any service interruptions.
  • 3PL: Transfer inventory transactions and other records from third-party warehouse management systems into the Odoo Inventory module.

The Odoo MySQL Connector module makes the process of connecting your external MySQL databases with Odoo 19 easy. The module allows business administrators to create effective data transfer processes in a few steps, saving time and effort otherwise spent on creating custom scripts.

To read more about How to Configure and Use Amazon S3 Connector in Odoo, refer to our blog How to Configure and Use Amazon S3 Connector in Odoo.


Frequently Asked Questions

What is Odoo 19 MySQL Connector?

This is an integration tool connecting Odoo 19 with any MySQL databases, helping to import and synchronize data without creating special integration scripts.

Does it offer a possibility to map fields?

Yes, the tool recognizes all columns in tables from the MySQL database and helps to map every column to the corresponding Odoo field.

Does coding need to be used to implement this connector?

No, the configuration of connections, fields mapping, and synchronization processes can be done without coding.

What are the most frequent use cases in the business?

The connector is designed for integration of old ERP systems, eCommerce platforms, warehouse management systems, CRM databases, and other tools based on MySQL.

If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



WhatsApp