City import


How to import cities database? We are using World Cities Database | Basic database downloaded as .csv file.

We tried doing the following:

  1. In Application Config >> Technical maintenance >> Imports >> Press on + to add new import
  2. Select Binding file:
<csv-inputs xmlns=""

    <input file="worldcities.csv" separator=";" type="com.axelor.apps.base.db.City" search="self.importId = :id">
      <bind to="country" column="iso2" search="self.alpha2Code =:iso2"/>
      <bind to="name" column="city_ascii"/>
      <bind to="importId" column="id"/>

  1. Select Data file (example of first few rows):

Neither Binding file nor Data file is accepted by the Import, it gives no error.

Trying to press Import button shows error:

The following fields are invalid:

  • Binding file
  • Data file

Is this the correct way of importing cities?
Are there any other alternatives how can Cities be imported into Axelor?


This post might help you:


Hello, thank you for your reply.

I have seen that post, but Geonames does not provide all required cities.

We have found another database that does provide all required cities, but we are unable to import it as explained in the previous post.

If you use xml file csv-inputs and csv import, theses data are loaded only when you install the module. Not with an Axelor tools

Hello Egaras,

I have recently encountered the same issue with data import. I still can’t solve it.

PHPierre, I am using a csv-config file in which I placed my csv-inputs but it doesn’t work. I still can’t see the cities imported in my database. I didn’t find any documentation about where to put the csv-config file in the project, the problem may be that this file is not correctly placed ? Or maybe it’s because the csv file is misplaced too…

Egaras, I am guessing that you’re trying to import your data directly from the app ? Not from the source code of your project ?

Here is the standard tree of Axelor module for importing csv file :

You put all your csv in the input folder.
Your file with the csv-inputs should be inside the input-config.xml.
After, you need to install reinstall everytime your module because input-config file is only read when you are installing a module.

I hope this can help you. If your data are false, you can see logs during this moment.

1 « J'aime »

Thanks for your answer I will check that !

In tout csv you have a column id . Replace it par import id . Never make a column id , its auto generated by data base server on the insert statements

This seems to be what we were looking for.

Thank you for your response.

No problem, axelor documentation is not easy to read because something missed examples or details.
have a good day

bind to=importId column=id/> Sorry i don t have see this line

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.