Setting up the Akeneo Connector in Magento 2: Part 2 - Running the Jobs

by Matt Helm
February 24, 2021

NOTES:

  • This article assumes that you have already done the initial setup of your Akeneo Connector. If you have not yet configured the connector please follow the steps in Part 1 before returning here.
  • This article refers to v101.0.0 and beyond of the Akeneo Connector module. If you are using a different version the information here may not apply.

Now that you have your connector setup in Magento 2, it is time to run the jobs and sync your data. The jobs are listed at System > Akeneo Connector > Import in the Magento Admin Panel. From there you will see buttons for the following jobs: Category, Family, Attribute, Option, and Product.

Each job will sync the related information from Akeneo.

The Category job syncs the category data from Akeneo. Only one category tree will be imported with this command. The imported category tree is determined by the channel designated in the Admin Website Channel field in Magento. Only the main category tree of that channel will be synced. Other category trees in Akeneo will be ignored.

The Family job brings over the data for all families in Akeneo.

The Attribute job pulls new and updated attribute information from Akeneo.

The Options job creates attribute options from Akeneo and adds them to Magento for each new or updated simple select and multi-select attribute.

Lastly, the Product job pulls all your Product, Product Model, and Family Variant values from Akeneo into Magento.

Initially you will want to run the jobs in the following order:

  • Attribute
  • Option
  • Family
  • Category
  • Product

This order ensures that all dependencies for the data being imported are met. After your initial data load, you do not need to rerun all jobs. Instead, you can just run the job for the related data that was updated. For example, let's say you added a new family to Akeneo. If the new family contains new attributes you will need to run the Attribute and Option (if the new attribute is simple or multi-select) jobs. If the family only has old attributes you can ignore the Attribute and Options jobs and just run the Family job.

All five jobs can also be run from the command line. Running the jobs from the command line is beneficial for two reasons. First, it allows you to run longer jobs without risking a timeout. Second, it allows you to set the jobs to run automatically on a schedule. The command to run these import jobs is added to the existing Magento command list when you install the Akeneo Connector module.

Running the command will look something like this:

/usr/bin/php /magento_root_directory/bin/magento akeneo_connector:import--code=product

The first section is the route to php. The second section is the route to Magento root. The third section is the command. The fourth section is the desired job to run. If you would like to run multiple jobs you can provide a comma separated list to the code parameter (ex. --code=attribute,family,product).

Though powerful, these jobs are not perfect. All the jobs only support adding and updating data. They do not support deleting data. As an example, let's imagine you add a new product into Akeneo with SKU 1234. The first time you run the product job product 1234 will be added to Magento. If you change attribute values on product 1234 in Akeneo, then run the product job again, those values will sync. However, if you delete product 1234 in Akeneo, running the product job will not remove product 1234 from Magento.

Sometimes the import jobs fail. Each time you run a job it generates a report. These reports are located at System > Akeneo Connector > Import. Looking at a failure report is a great starting point for trying to figure out what caused a job to fail.

There are several reasons why a job can fail. One of those reasons is the MyISAM engine. The MyISAM storage engine is very fast for data calls with a lot of reads and few writes. This is great because it speeds up the data reads that need to happen when transferring information from Akeneo to Magento. However, not all hosting platforms support MyISAM. If your database hosting platform does not support MyISAM you will have to comment out the code $table->setOption('type', 'MYISAM'); from line 264 in the file vendor/akeneo/module-magento2-connector-community/Helper/Import/Entities.php. Commenting out this line will prevent the MyISAM engine from being forced and will use your system's default engine instead.

With this article, you can now populate Magento 2 with your entire Akeneo catalog.

What if you don't want every single product to be sent to Magento? Perhaps you want to sync enabled products or to only send products that are 100% complete. The Akeneo connector provides some wonderful filtering options that you can use to control the data flow between your two systems.

Check out Part 3 of this series (coming soon) to learn more about filtering.

Sitation Blogs

Sitation is a 2021 "Triangle Tweener"
by Steve Engelbrecht

Akeneo PIM for Projects of Any Size: A Guide to Data Structures
by Christina Smithers

Meet Sitation at Akeneo Unlock 2021
by Sitation Staff

Akeneo: Requiring an SSL Connection with Elasticsearch using Apache
by Don Bales

Akeneo: Requiring an SSL Connection with Elasticsearch using XPack
by Don Bales

Setting up the Akeneo Connector in Magento 2: Part 2 - Running the Jobs
by Matt Helm

Content Creation Part One: How Focusing on Copy Elevates eCommerce Strategy
by Autumn Demonet

How to Choose Axis Attributes When Building Product Models in Akeneo
by Britney Bowen

Keeping It Real While Working Remotely
by Tamara McGuigan

How to Channel Your Inner PIM: Helpful Hints for Achieving Syndication Zen
by Rachel Maley

Setting up the Akeneo Connector in Magento 2: Part 1 - Initial Configuration
by Matt Helm

Salsify's Powerful Channel Syndication Features - How to Deliver the Right Data to Downstream Channels
by Steve Engelbrecht

Sitation Earns Gold Akeneo Partnership, Expands PIM Delivery Capability
by Steve Engelbrecht

Steps to a Successful Akeneo Implementation: Part 1 - What are your goals for PIM?
by George Dzuricsko

A Deep Dive into Akeneo's Product Version History
by George Dzuricsko

An Akeneo Primer: Workflows 101 - How To Work the Workflows
by Brad Johnson

Help! My Products Are Suddenly Missing in Akeneo
by Matt Helm

Cheat Sheet: 9 Steps to a Successful Akeneo Implementation
by Sitation

Why You Should Adopt Akeneo's Built-in Tools Rather Than Forcing Functionality Into Akeneo
by Matt Helm

Akene-Oh No: Common Pitfalls to Avoid When Using the Akeneo PIM
by Matt Helm

Why Better Taxonomy Is a Delight to Merchants and Consumers Alike
by Autumn Demonet

5 Fundamentals to Master Product Experience Management
by Catherine Marquand

Akeneo: Requiring an SSL Connection with MySQL
by Don Bales

Akeneo: The Missing MTA Documentation
by Don Bales

Keys to a Great Akeneo Discovery
by George Dzuricsko

Sitation Earns Silver Partner Badge with Akeneo PIM
by Steve Engelbrecht

Ecommerce Veteran Sitation Finds New Opportunities Despite Pandemic
by Elizabeth Moore (GrepBeat)

B2B E-Commerce: Where should I start?
by Steve Engelbrecht

Akeneo 4.0 Features We Are Most Excited About
by George Dzuricsko

Sitation Announces Partnership with Akeneo
by Sitation Team

Work From Home Productivity Tips
by Steve Engelbrecht

Ecommerce Trends for Digital Transformation in 2020
by Megan Fitzpatrick

A Distributor's Guide to Sourcing Product Content
by Craig Lewis

An Efficient Taxonomy Can Benefit Your SEO
by Megan Fitzpatrick