Magento 2 Product Import

-

Apart from the control of processes, a central component of Pacemaker consists of the framework for the import of products. Being a framework on the one hand and a complete solution for the import of the entire catalog on the other hand, the product import, which is still frequently based on CSV files, is actually the main focus of Pacemaker.

Steps for the Product Import in Magento 2

This post shows step by step how products can be imported quickly and easily into the webshop as a CSV file. For simplicity we use the Magento demo data, which can also be downloaded completely in CSV format from our Github repository. This article assumes that the Magento instance is already installed either with demo data or with bin/magento sampledata:deploy. Unlike the Magento Standard Import, Pacemaker expects the product data to be delivered in the standard CSV format, but adjustments can be made via the configuration if necessary.

The import of products takes place in three simple steps and ensures at all times that it does not collide with other running processes.

Step 1: Configure the Pipeline

Step 1 involves customizing the product import to the current conditions and uploading the CSV files to the server. By current conditions we mean if new products should be added, replacing or deleting existing ones. Furthermore, when creating new products, you can configure a specific mode to be used. Besides the standard mode, there is the option to check on column level (Change-Set Detection) or even on row level (Timestamp Detection) during the import, in order to see if the data of the product has changed at all.Depending on the complexity of the data, both accelerate the import up to a factor of 4. The Timestamp Detection implies that the updated_at date in the CSV is set and up-to-date, which is simply not possible in many PIM + ERP systems, because they do not carry any information about the last modification date of an entity.

SCHEDULE A DEMO

Step 2: Start import (Creating the .OK file)

Configuring the import and uploading the CSV files with the product data is the first step. Once completed, a so-called .OK file must be created, which signals to Pacemaker that the CSV file has been completely uploaded to the server. This ensures that the import, which is executed asynchronously via a pipeline, does not start during the upload. The following steps are necessary to create the .OK file.

SCHEDULE A DEMO

Step 3: Monitor the Import Process

Contrary to Magento Standard or other modules, the import process is performed asynchronously via a so-called pipeline. This pipeline, supported by the distributed architecture of Pacemaker, could also be executed on one or more other servers. After the .OK file has been successfully created, a new pipeline is automatically created consisting of several steps. As a first action, the new pipeline stops the Magento Indexer and ensures that the import process does not collide with the indexing process, which is one of the most common problems of long-running import processes in Magento. After a successful import, but also if the import is aborted, the Indexer is reactivated by Pacemaker.

SCHEDULE A DEMO

Result & Benefits

Importing via the pipelines, Pacemaker ensures at all times that no other processes, such as the indexer, collide with the import process. In reality, especially with larger systems, nobody uploads the product data to the Magento Admin, but rather the data is automatically provided by a PIM (Akeneo) or ERP (SAP) system on the server and then automatically processed by Pacemaker.

After the indexers, which are reactivated after the import process, have indexed the imported products, the catalog in the store is up-to-date again.