Mass imports

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

Following a new installation of Dolibarr, the database is empty. It is a common requirement to import existing data (suppliers, customers, products etc.) instead of entering the data manually. There are several possible methods of importing data. The following chapters provide information about this. Information about exporting data is described on the page Module Exports.

Art.png Using the Dolibarr Import Module

The recommended method for importing data is to use the Dolibarr Module Imports. You will find a wizard that will guide you step by step in importing your data. You'll find more information on the page Module Imports.

For import scenarios not covered by the built-in module, the following alternatives are also possible.

OpenOffice.png Using OpenOffice

You can use OpenOffice, which is able to insert the contents of a table into a database such as Mysql Dolibarr. Here is a tutorial on this method: Import data with OpenOffice

Outils.png Developing your own import script

Import third parties and contacts

We must differentiate a third party from a physical contact (person). The third party information contains all the details pertaining to billing (whether companies, private individuals or associations). Third party details are compulsory whereas physical contact details are optional. Contacts are just a directory of physical persons/addresses related to the third party. In the case of a third party that is a company, there may be several additional physical contacts. In the case of an individual, there will be only one physical contact which would be identical to the third party.

The import of the third parties inserts rows in the table Table llx_societe. Ensure that the mandatory fields contain data.

  • Name: Must contain the name of the company
  • Client: Must contain 1 if third party is a client, 2 if prospect, 0 otherwise.
  • Supplier: Must contain 1 if its a supplier, 0 otherwise

The import of physical contacts inserts rows in the table Table llx_socpeople. Ensure that the mandatory fields contain data.

  • Name: Must contain the surname of the contact
  • Firstname: Must contain the first name of the contact
  • fk_soc: Must contain the id of the third party from table Table llx_societe.

Special Notes for certain import fields when you are importing Excel files (CSV or XLSX)

  • Field Type Date The default formatting abilities in the US Excel can be used (i.e. 2022/01/19 or 2022-01-19). You must highlight the column in Excel and with <CRTL><1> you get to the formatting menu. From there click "Date" and choose format "2022-01-19". Afterwards click "Custom" and you will see the format information "yyyy-mm-dd,-@". Delete the dashes and the character after dd. Now everything will show in the Excel column as needed for Import.
  • Field Type Country Although Dolibarr displays fully spelled out name such as "United States", Dolibarr only imports the two-digit Country code. A complete list of the countries in the world can be found here: Country Codes
  • Field Type State/Province Similar to Country Code (in particular US states) which are displayed for example as "MA - Massachusetts", Dolibarr only wants the two-digit State Code. A list of US State codes can be found here: United States. | Canada | Australia | Brazil | Mexico and France is a 3 digit code France

Import invoices

To complete...

Import products

To complete...

Put into practice

Page Script development explains how to create your own Dolibarr script.

Some tutorials / examples submitted by the community

Some scripts examples are available into Dolibarr snapshot distribution in directory /dev/examples.

Other examples are provided by contributors:

Related video

(vocal in french but subtitles are available and review in this language)