Data migration is the process of migrating existing data to the new version or new ERP.
Since it’s a complex process, it needs to be done with the utmost care, and the old data needs to fit into the new business logic without any data loss. In the case of Odoo, there may be a need to migrate data from old versions to the latest one. It can be challenging because, with changes in the new version, we need to migrate the data from an old database to a new one.
In this blog, we are going to discuss how we can simplify this data migration process using Talend.
Talend is an open-source ETL tool that offers data integrations and data management. Talend OpenStudio is a product of Talend. With Talend OpenStudio, we can perform operations on data such as data migrations and different ETL operations like extraction, transformation, and visualization. We are using the “Talend Open Studio for data integration” tool for our purpose.
For downloading Talend open studio go to this given URL: https://www.talend.com/lp/open-studio-for-data-integration?utm_medium=help&utm_source=help_content&_ga=2.223266395.1308083811.1658910477-1223366348.1642431324
Fill out the form and click on the Download Now button.
After submitting the page, it will redirect to the page like this.
Then check your email. An email will be received like this.
Click on the specific link based on your OS, and then the application will start downloading automatically.
After the download was completed, extract the zip folder. In order to use Talend Open Studio, you must install java in your system.
The extracted folder will look like this. Double-click the executable file corresponding to your operating system to open the Open Studio. In the case of Linux, TOS_*-linux-gtk-x86_64.
After double clicking the executable file, the application will open.
In the next step, set a project name and click on Finish.
After that, the application will open.
Now the Talend Open Studio application is successfully set up.
Now we can see how to migrate data from an old version to a new version.
For example, we are trying to migrate the CRM tags data in the odoo13 database to the odoo15 database.
This is the odoo13 database, and we are migrating this Tags data to the odoo15 database.
Initially, in the odoo15 database, there is no tag data present.
First of all, we are creating database connections in Talend Open Studio.
For that, In the left side panel, click on Metadata, right click on Db Connections, and click Create connection.
A wizard will open, enter a name for database connection and click on Next.
In the next wizard, select DB Type as PostgreSQL and give the odoo13 postgres username and password. Here I am given the server as localhost and enter the database name.
You can use Test Connection to check the connection. If everything is fine, then a successful connection message will be displayed.
Click on a finish to complete the database connection.
Now the database connection is successfully created, we can see the created connection under Db connections.
Now we need to import the schema. In our case, we are migrating CRM Tags model data, so we are going to retrieve this schema from the database connection.
For that, right-click on the created database connection and click on Retrieve Schema.
A wizard will open. Click on the next button.
In the next wizard, inside the Name Filter, search for the model name we need to import. In our case, it’s crm_lead_tag. Inside the list table, open the public, select the corresponding model and click on Next and click Finish.
Now that table is successfully imported. You can see it under the Table Schemas in the Database connection.
Similarly, create a database connection for the odoo15 database and import the schema, follow the same steps. Give the credentials for the odoo15 database.
In odoo15, the CRM Tags model name is crm.tag it’s different from the odoo13, so while retrieving schema, use this model name.
Now we have successfully created a database connection for the odoo15 database and imported CRM Tags table.
Now we create a job in Talend to migrate the data from odoo13 to odoo15.
Right click on the Job Designs in the left panel and click on create job.
Open a wizard, give a name for the job and click on Finish.
Now a job will be created, and it will be open on the screen.
For migrating data between databases, we need to drag and drop the database connection we created into this job screen.
From the left panel, Inside Db Connections, drag and drop the odoo13db connection to the job screen, then a popup will shows there select the component as tDBInput(PostgreSQL)
Similarly, drag and drop the odoo15 db connection to the job screen. In the popup, select the component as tDBOutput(PostgreSQL)
Now the database connections are imported. Now we need to map these connections.
From the right-hand panel, search for the tMap component and drag and drop the tMap component to the job screen in between two database connections.
Connect odoo13 db to tMap by right-clicking on the odoo13db and click on Row -> Main, and connect to the tMap.
Now double click on the tMap component. It will open a page like this and click on the plus icon on the right side.
Give a name for the output connection and click on OK.
And click on the OK button at the bot.tom
Now right click on the tMap component and click on Row -> there shows the new output connection we just created (odoo15out). Click on it and connect to the odoo15 db.
Now the connection between two databases is added, we need to map the data.
Double click on the tMap component.
This page will open. Click on Auto map on the right end.
It will automatically map the matching fields from the two database tables.
If we don't need to map a field, then remove that field's expression on the output connection side.
Now click on the OK button at the bottom.
We completed the Job design, now we can run the job.
For running the job, click on the green icon in the topbar.
The log will be displayed here. If any error occurred while running the job, then it will also be displayed in the log.
Our job ran successfully without any error. Now the migration is completed. The CRM Tags data from the odoo13 database is migrated to the odoo15 database.
We can check the odoo15 database,
After running the job in Talend, all the Tags data from odoo13 db is migrated to odoo15 db.
This is a simpler table migration done using Talend Open Studio. Similarly, we can also migrate extensive database table data.