Collection Import AND/OR CLI to import files?

I have some data in json format that can correspond to collection structure, can I import a collection file to cockpit?
I see that there is import button in assets and in modules/Collections/cli folder there are some import export scripts, but anyone know how to use them?

Are there any CLI commands for cockpit?

I would love to know, how can I import my data too.

I think no-one answered to me because to answer was so obvious and I found it later.
you can find Import/export in menu that you can see when you hover over collection:


import it self let you even import relations to other collections (you can filter fields), which is very cool and let you quickly get your data in place.
But for some reason if you export data and then reimport it with cockpit it cannot make the connectionLink correctly

1 Like

Thank you for your answer.

but strangely nothing appear when i’m on my collection and when i hover the name.

so bad :frowning:

sounds like you are missing the needed access rights to import data - retry it as admin user

1 Like

Right, we need to be admin!

Is someone know how to transform MySQL database to JSON file?
I already created a JSON file from my SQL server:

places: [

   id: "2",

   structure_id: "2",

   nom: "Allô Candy asbl",

   secteur: "0-3",

   adresse: "9, rue Louis Bréguet",

   codepostal: "6041",

   ville: "Gosselies",

   telephone: "071/45.03.33",

   gsm: "",

   email: "",

   web: "",

   description: "La Crèche d'Allo Candy asbl dispose de 48 places.",

   categorie1: "Structure d'accueil",

   souscat1: "Crèche",

   souscat2: "",

   latitude: "50.47487",

   longitude: "4.47205"},

 { ...

just did a quick google search. Try this:

Btw, you can also import csv files :point_up:

1 Like


Actually when we try to import our JSON file, we got this:

and nothing move further.

Do you know why?

Thank you,
Une Nouvelle Ville ASBL

try pressing Control+Shift+J in order to open the chrome developer console (guessing you are using chrome). Check if there are any console errors when you are trying to import data