How to export and import data objects in Pimcore (2024)

How to export and import data objects in Pimcore (3)

This guide will show you how to migrate Pimcore data objects from one server to another using Pimcore’s built.in CSV export/import functionality.

Let’s say that during development you created a new class Car and you added a couple of objects of that class on your local machine. Now you want to create those objects on a live server too and the simplest way to do this is to use CSV export/import functionality.

1) Export objects

To export objects, click on a folder or an object that contains all the objects you want to export as children (meaning that they are under the folder/object). If you clicked on the folder go to the “Search, Edit and Export” tab, and if you clicked on the object, go to the “Children Grid” tab. There you’ll see a table that contains data about the objects you want to export.

How to export and import data objects in Pimcore (4)

Now you can select which data you want to export by clicking on the “Grid Options” button in the top right corner. A popup will appear that will allow you to specify which fields from the Car class you want to export. On the left side, you can see all available fields, and on the right all currently selected fields. Fields can be added by double-clicking on them or by drag and dropping them in the right table.

Make sure that you selected either ID or Full Path fields because we will need them later while importing.

How to export and import data objects in Pimcore (5)

When you select everything you want click on the “CSV Export” button in the top right corner and just select the delimiter for CSV (by default it is ’;’) and your export will be done.

2) Import objects

When you want to import objects, right-click on “Home” in the DataObject tree and go to “CSV Import” and select for which class you want to import objects.

How to export and import data objects in Pimcore (6)

It will ask you to upload a CSV file that contains import data. Once the file was selected, a new screen will appear and you’ll have to adjust a couple of settings before importing.

How to export and import data objects in Pimcore (7)

TIP: If you are importing relations, make sure that those related objects exist in the same path that’s defined in CSV, in the system in which you are importing. Otherwise, those fields will be empty.

Go to the “Column Configuration” tab. There you must connect fields from the CSV file with fields in the class you are importing. On the left, you can see the fields in the Car class, and on the right, you can see the fields in the CSV file. Now you have to connect those by dragging and dropping the class field on the corresponding CSV field.

If you have special fields in the class like localized fields, you’ll have to use operators that can be found in the bottom left corner. For example, field Name is a localized field and because of that, we have to use Operator Locale Switcher to define for which language we want to import data (check the image below).

How to export and import data objects in Pimcore (8)

Once you are done with column configuration switch to the “Resolver Settings” tab. Here you’ll need to tell Pimcore how to create/update your objects. The most important options here are:

  1. Language — define for which language you want to import data (if this is defined you don’t have to use operator locale switcher in column configuration)
  2. Resolver strategy — this tells Pimcore how to create or find if an object already exists. We will use the “Full Path” strategy
  3. Column — which CSV column should be used for resolver strategy, here we will select the column that contains the full path for our objects
  4. Create on demand — we need to check this so if objects don’t exist they will be created
  5. Create parent — check this too, it will create parent folders for our objects if those folder doesn’t exist

Other options you can leave as default.

How to export and import data objects in Pimcore (9)

Once everything is defined we can click “Import” in the bottom right corner, and if everything is defined correctly, the import will start and create/update objects.

If you followed this tutorial closely you should be able to see imported data objects in the data object tree. If not, try with all the steps :)

How to export and import data objects in Pimcore (2024)
Top Articles
Latest Posts
Article information

Author: Rueben Jacobs

Last Updated:

Views: 5413

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Rueben Jacobs

Birthday: 1999-03-14

Address: 951 Caterina Walk, Schambergerside, CA 67667-0896

Phone: +6881806848632

Job: Internal Education Planner

Hobby: Candle making, Cabaret, Poi, Gambling, Rock climbing, Wood carving, Computer programming

Introduction: My name is Rueben Jacobs, I am a cooperative, beautiful, kind, comfortable, glamorous, open, magnificent person who loves writing and wants to share my knowledge and understanding with you.