Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to Export and Import data in OpenERP 7

By
pdeli
on 6/24/14, 10:58 AM 3,167 views

Dear all,

It makes now almost a week that I am trying to export data from one OE7 database to import it in another one. Here's my problem (I do not want to restore a Postgresql database):

  • I am using OpenERP Version 7.0-20140620-231150
  • I created a database, lets call it DB1, with the following Apps installed
    • Project Management (which also installs the Social Network app)
    • Accounting and Finance
    • Sales Management
    • Employee Directory
    • Timesheets
    • Address Book
  • However, the people for whom I am installing the database don't need all this, they only need
    • Project Management (which automatically installs the Social Network app)
    • Employee Directory
    • Address Book
  • So I created a new database, lets call it DB2, with only the 3 needed apps mentioned above
  • And I thought about exporting from DB1, say the Users, and importing them in DB2
  • However there always seems to be a bug at import, on the lines of: "No matching record found for external id '__export__.mail_alias_139' in field 'Alias' between rows 3 and 4"
  • So I first tried to tackle each of the "issues" OE7 seems to find at import
    • I spent almost an entire day doing it, diligently, until I realised that only a few columns remained but OE7 was still not happy.
  • I thought that as there were more Apps in DB1, DB2 could not import the data generated in DB1 and that I was stuck with all those unwanted Apps.
  • So I thought about doing the export process the other way around (DB2 to DB2):
    • by creating only one user in DB2 (apart from the administrator),
    • exporting the data in CSV,
    • erasing the user and
    • reimport it in DB2,
    • but oddly enough, OE7 is creating the same kind of messages as in the original DB1 to DB2 imports...

Could anyone tell me what is going on? If the DB1 to DB2 transaction does not work, it is imaginable because the installed Apps are not the same. But come on, from DB2 to DB2, that should work...

What are the fields needed if I want to have say the following items (for the moment only Settings -> Users):

  • Preferences tab
    • Picture
    • Name
    • Login
    • Company
    • Active
    • Language
    • Timezone
    • Signature
  • ​Access Rights tab
    • Sales
    • Project
    • Human Resources
    • Sharing
    • Administration
    • Contact Creation

I would like to do the same with the Projects and the Human Resources Apps (the show the same kind of issues as the Users Export-Import in Settings).

Thanks in advance for any advice/help,

Peter

++++

I cannot remember it's name off-hand, but there is a special data table dedicated to correlating external IDs to internal IDs. If you have not addressed the problems of having that match up correctly you will fail at this. My understanding however, is that attempting to bypass the ORM layer and go directly to the database will involve you in an endless tangle of problems. The "safe" route in is via XMLRPC.

Martin
on 6/24/14, 1:20 PM
0

Ray Carnes

--Ray Carnes--
15687
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 6/25/14, 3:30 PM

When you activate Developer Mode, you can hover over each field on any screen to see what the database field name is (the one that you need to select when exporting).

You should continue to work on the learning curve of importing via CSV.  It works fine once you understand the way it works, but it does take work.

Database imports I would never do.  XML-RPC is a fine alternative approach.

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 6/24/14, 12:15 PM

Peter,

If I would be you, I would take different approaches.

1. Create a python script which will read from DB1 and send records to DB2. This should be done per model.

2. Pgadmin gives you a facility to export the SQL, this should be perfect match.

The above options are done on the background, so DB2 has the values as exactly the DB1 had.

3. View-wise bugs should be fixed as and when you face them. You should have a list of fields that are changed/removed/added on any model in v7.

Hope this helps.

We may even discuss your problems one by one.

Thanks.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/24/14, 10:58 AM
Seen: 3167 times
Last updated: 3/16/15, 8:10 AM