Skip to content

PIMGento 2 for Akeneo

Installation

See https://github.com/Agence-DnD/PIMGento-2/blob/master/doc/important_stuff/how_to.md

Configuration

Import using rows

If you're unable to set MySQL permissions for LOAD DATA INFILE commands:

  1. Stores > Configuration > Catalog > PIMGento
  2. Expand General
  3. Set Data Insertion Method to "By Rows"

Import preconditions

Before importing with PIMGento you should have your Akeneo export profiles created for (Categories, Families, Attributes, Options, Variants).

  • Go to your Akeneo dashboard
  • Click on "Exports" in the menu
  • Click "Create Export Profile"
  • And create profile with the code and label you prefer and the job matching what you need so for Category the job would be "Category export in CSV" which is part of "Akeneo CSV Connector"

Command line import

When importing Akeneo CSV's to Magento, please follow the "import order" sequence from this page The sequence is like this: Import Categories csv first, then families, then attributes, then options, then variants, then products.

Also to get available import options execute php bin/magento pimgento:import.

You might also need to create {your-magento-root}/var/import/pimgento import and pimgento directories because they might not exists.

  1. Export a Product CSV from Akeneo
  2. Save the CSV file in a location accessible on Magento's server
  3. Anywhere except /tmp/whatever.csv since Akeneo uses that as its temp store. A subfolder such as /tmp/subfolder/whatever.csv is fine
  4. Run php bin/magento pimgento:import --code=product --file=/tmp/akeneo/product.csv
    • If you see a MySQL error SQLSTATE[28000]: Invalid authorization specification: 1045 Access denied for user [...] query was: LOAD DATA INFILE, you need to either grant permission, or import using rows

Note

If absolute path for csv file import with a flag --file= doesn't work. Try placing them in {magento-root}/var/import/pimgento

When importing products using Pimgento to magento 2

If you see an error something like below, remove tmp_pimgento_entities_product table and truncate pimgento_entities table

[11:59:17] SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row, query was: 
            UPDATE `tmp_pimgento_entities_product` t
            SET `_entity_id` = (
                SELECT `entity_id` FROM `pimgento_entities` c
                WHERE t.`sku` = c.`code`
                    AND c.`import` = "product"
            )