How to Export Products from Magento 2 Open Source & Adobe Commerce via CLI

- E-Commerce, Magento 2

Magento CLI: product export

Although most Magento 2 administrators prefer working with their e-commerce website’s strengths in the admin area, there are still many people who require the same management opportunities to be implemented with the command-line interface. However, the default data transfer solutions of Magento 2 Open Source and Adobe Commerce don’t support Magento CLI commands. Both import and export tools are enough for basic purposes only. If you want to export products from Magento 2 via CLI, you need a third-party solution. In the following material, we describe how to transfer data via CLI from your e-commerce website (Magento Open Source or Adobe Commerce) with the help of Improved Import & Export. Besides, we shed light on the corresponding data import processes based on the Magento 2 CLI commands. So, follow the steps below to export Magento 2 products using CLI commands. 

Magento 2 Product CLI Export Step 1: Install Improved Import & Export

First of all, you need to install the Improved Import & Export Magento 2 extension to be able to export products from either Adobe Commerce or Magento Open Source. Note that our specialists can help you do that. Contact our support for more information.

Get Improved Import & Export Magento 2 Extension

Also, you can find a detailed description of how to install our module here: Improved Import & Export Manual.

Magento 2 Product CLI Export Step 2: Create Product Export Job

Now, proceed to System -> Improved Import / Export -> Export Jobs and click the Add New Job button. For more detailed instructions, follow this link: How to Add a New Export Job

magento cli: add new export job

Magento 2 Product CLI Export Step 3: Export products from Magento 2 via CLI

Now, you can export products from Magento 2 via CLI.

Magento CLI Commands: Export

The Improved Import & Export Magento 2 plugin lets you enable, disable, or start export processes from the Magento 2 CLI interface. You have to run the following commands in the Magento 2 root folder:

Magento 2 Product Export CLI Command

Now, use this command to export products from Magento 2:

php -f bin/magento export:job:run

Note that if you don’t specify a job ID, this will launch all export jobs.

You will see the following information in the terminal (the ID is specified):

Please contact our support to get the latest command versions.

Magento 2 CLI Commands for Import

Use the following commands to import data to Magento 2 Open Source or Adobe Commerce via CLI:

Note that for both import and export processes, you have to create corresponding jobs. If there are no import or export profiles, there is nothing to control via the command-line interface.

Final Words: Magento 2 Product CLI Export

Since it is impossible to export products via CLI using the default Magento Open Source or Adobe Commerce data transfer tools, we recommend using the Improved Import & Export Magento 2 extension as a reliable addition to the default functionality of Magento 2. This module enables the missing feature and adds tons of possibilities: automated transfers, mapping, additional data standards and sources, etc. For further information about the extension, follow the link below:

Get Improved Import & Export Magento 2 Extension

Magento 2 CLI Import & Export FAQ

Below, you can find the same information that we’ve just provided above in the form of questions and answers.

How to disable an export job via CLI in Magento 2?

Use the following command to disable an export job in Magento 2 via CLI:
php -f bin/magento export:job:disable JOB_ID

How to enable an export job via CLI in Magento 2?

Use the following command to enable an export job in Magento 2 via CLI:
php -f bin/magento export:job:enable JOB_ID

How to run an export job via CLI in Magento 2?

Use the following command to run an export job in Magento 2 via CLI:
php -f bin/magento export:job:run JOB_ID

How to disable an import job via CLI in Magento 2?

Use the following command to disable an import job in Magento 2 via CLI:
php -f bin/magento import:job:disable JOB_ID

How to enable an import job via CLI in Magento 2?

Use the following command to enable an import job in Magento 2 via CLI:
php -f bin/magento import:job:enable JOB_ID

How to run an import job via CLI in Magento 2?

Use the following command to run an import job in Magento 2 via CLI:
php -f bin/magento import:job:run JOB_ID