How to Sync Data Using CLI

This is an article from the KatanaPIM extension for Magento 2. We've tried our best in the preparation of this help article. If you do not find the answer you were looking for, you can always send us a message through this form.

How to Sync Data Using CLI

You can use the `katana:import:full` CLI command to manually trigger synchronization from Katana PIM into Magento. This is useful for debugging, deployments, or syncing specific data types on demand.

Basic Usage CLI

Full Synchronization: Attributes, Categories, Products & Assets

To run a full synchronization, execute:

bin/magento katana:import:full

What This Command Does

  1. Fetches the latest data from Katana PIM via API.
  2. Updates data in Magento — only if allowed by config (see below).
  3. Optionally performs reindexing.
  4. Removes outdated products/categories/assets if necessary (CLI-only).

If no options are passed, all entities are synchronized.

CLI Options

You can limit the import to specific entities by passing one or more flags:

Option Description
--attributes Sync attributes only
--categories Sync categories only
--products Sync products only
--assets Sync media assets (images) only

You can combine options to control exactly what is imported.

Examples

Sync only products

bin/magento katana:import:full --products

Sync attributes and categories only

bin/magento katana:import:full --attributes --categories

How the Sync Works

Synchronization Phases

Each selected section goes through two phases:

1. Fetch data from Katana PIM

Example CLI output:

 Update Katana Products... 4000/61151 [=>---------------------------]  6%  56 secs  398.5 MiB

This step pulls in the most recent data from the Katana PIM platform.

2. Update data in Magento

Once the Katana data is imported, it’s processed and used to create or update Magento entities. Example:

Update Magento Attributes... 989/989 [==============================]  100%  3 secs  94.5 MiB  => Executed successfully  

Controlled by Configuration

Whether Magento is allowed to create new entities is controlled by the following settings:

  • Create new categories:
    Stores > Configuration > KatanaPIM > Automation > Auto create new categories
  • Create new products:
    Stores > Configuration > KatanaPIM > Automation > Auto create new products

If these are disabled, Magento will skip creation/update for those entities, even though data is fetched from Katana.

Cleanup of Deleted Entities (CLI Only)

Delete-Check After Full Sync

After a full CLI sync, the system checks whether any products, categories, attributes, or assets should be removed from Magento.

This comparison is based on what was fetched from Katana vs. what exists in Magento.

This delete-check only runs when using the CLI. It does not run during cron-based syncs.

Reindexing

Index Mode Recommendation

If the setting "Auto reindex after sync" is enabled (under Katana configuration), Magento will automatically trigger a full reindex after the import. This ensures your storefront immediately reflects the new data.

We strongly recommend setting all indexers in Magento to:

Update on Schedule

You can check current indexer modes:

bin/magento indexer:show-mode

Set all indexers to schedule mode:

bin/magento indexer:set-mode schedule

Why?

  • With "Update on Save", Magento triggers reindexing after every entity import, which is extremely slow for large catalogs.
  • With "Update on Schedule", indexing runs efficiently in the background or via cron.

Direct Help

At Magmodules, our support team is here to help you every step of the way. If you can't find a solution in our Knowledgebase, simply fill in the form below. We are in the Central European Timezone, and all your details are securely sent to us.
The more information you provide, the better we can assist you. Trust us to guide you through any challenge and ensure a seamless experience with our products and services.
Support by e-mail contact@magmodules.eu
star star star star star
star star star star star
Matt Austin
Possibly the fastest support response times of any Magento Extension vendor. Great extensions too!
Google 23 days ago
star star star star star
star star star star star
Jan Privé
Dankzij de heldere uitleg en snelle reactie van Magmodules kon mijn vraag, en dus mijn Magento-probleem, binnen enkele uren worden beantwoord. Doeltreffend, zonder moeilijke termen, gewoon zo als het zou moeten zijn.... Bedankt!
Google 27 days ago
star star star star star
star star star star star
Denis Metzler
To evaluate a provider, it is not enough to consider only the product offered, but also its after-sales service, such as support and troubleshooting. Magmodules has been extremely satisfactory at all levels on multiple occasions and sets the bar at the top when comparing the competition.
Google 30 days ago
star star star star star
star star star star star
Bleijenberg winkelinrichting en materialen
Goed bereikbaar, reageren snel en denken oplossingsgericht. Een aanrader.
Google 30 Jul 2025
star star star star star
star star star star star
Patrick Verduijn
Magmodules biedt plugins aan die van hoge kwaliteit zijn tegen een goede prijs, waar dit bedrijf in uitblinkt is de bereidheid om de zeldzame feedback & problemen met de plugins te willen onderzoeken, mee te willen denken in het debuggen van problemen en goede oplossingen toe te passen. In mijn decennium ervaring met Magento & 3th parties is Magmodules absoluut een uniqum binnen de markt.
Google 25 Jul 2025
star star star star star
star star star star star
Erik de Groot
Magemodules heeft hele sterke Magento extensies en een proactieve support. Al jaren heel erg tevreden over jullie service en producten!
Google 18 Jul 2025
star star star star star
star star star star star
René Zeuner
We are using the Mollie Magento extension from Magmodules. It works excellently without flaws. Very fast, competent and friendly support. Thanks!
Google 30 Jun 2025
star star star star star
star star star star star
R. U.
Erg goed team, reageren snel en duidelijk en hebben met toegang tot onze database erg goed geholpen (eigenlijk een gratis customization).
Google 18 Jun 2025
star star star star star
star star star star star
Hugo de Groot
Uitstekende support! Wij gebruiken o.a. de Rich Snippets Suite extensie voor onze Magento 2 webshop (Hyvä) en hadden een specifieke vraag over structured data op PLP-pagina’s. Binnen no-time kregen we een inhoudelijk en duidelijk antwoord. Zeer prettig contact en goed onderbouwde uitleg. Absoluut een betrouwbare partner voor Magento-extensies!
Google 13 Jun 2025
star star star star star
star star star star star
Rick Manders
Dit is nog eens een modulemaker! Stopt niet tot het werkt, blijft enthousiast. Grote dank!
Google 04 Jun 2025