How To Import/Export Categories to Magento 2

Magento 2 Development

Below, you will find a brief description of how to import/export categories between two Magento 2 websites. Unfortunately, this functionality is not available by default. Magento 2 leaves you alone with a huge category tree. You either need to recreate it manually or rely on third parties. So, welcome to our Magento 2 categories import tutorial. We know for sure how to import and export Magento 2 categories most efficiently.

The Magento StackExchange discussion inspired this post: question by Rafael Corrêa Gomes; answer by KAndy. However, it is only a partial overview of the Magento 2 category import and export. A full-featured guide on how to import and export categories, with all attributes explained can be found here: Magento 2 Categories Import Guide.

Magento 2 Categories Import & Export

If something is not available in Magento 2 by default, you can create a module that adds the necessary functionality. Of course, it is not the easiest way to get the desired features, but it can be the only available one. Luckily, the Magento 2 ecosystem is huge and there are already lots of third-party extensions that allow to enhance the platform’s default functionality. Often it is not necessary to recreate the wheel, since someone has already developed a Magento 2 extension with the feature demanded in your case. It is even possible to get key Enterprise Edition features on a Community-based website, but what about Magento categories import/export?

There are tons of data transfer solutions developed to enhance the default functionality of Magento 2, including our Improved Import extension.

Improved Import and Export of Magento 2 Categories

Improved Import and Export for Magento 2 is irreplaceable when it comes to data transfers. Be it categories or any other Magento 2 entity, the extension processes the entity specifics to the tiniest detail and allows performing flexible import and export based on the improved data transfer logic.

Import Behaviour

Thus, the Improved Import Magento 2 module allows to import of categories with different behaviors: Add / Edit, Delete, and Replace. The tool allows you to get all the necessary data within your Magento 2 store in the most precise manner.

File Formats & Sources

Improved Import and Export support various data sources which help you increase the efficiency of your export and make data transfers highly personalized. Google Drive and Google Sheets, FTP/SFTP, REST and SOAP API, Dropbox, URL, and file upload can be import sources for your Magento 2 category tree.

Our Magento 2 extension also works with multiple file formats, including CSV, ODS, XLSX, XML, and JSON files.

Attributes

Import and export files have a certain table structure, you can compose such files from scratch using our sample file in the Master Category Import Table. A CSV for Magento 2 categories import consists of the following attributes:

  • name – the name of a category;
  • url_path – the URL to a category;
  • url_key – the URL key of a category;
  • description – a column for category descriptions;
  • is_active – this attribute shows whether the category is enabled or disabled;
  • include_in_menu – this column shows whether the category should be included in the main menu on the frontend;
  • is_anchor – this parameter is necessary for layered navigation;
  • custom_layout_update – the custom XML layout update of a category.
  • Look for more attributes in our Master Table.

Other Features

As for other features available with the Improved Import Magento 2 extension, they allow setting category position and location. First of all, you can import categories by name and the full path to the category  (Default Category/Women/Dresses). Besides, it is possible to leverage parent category IDs to run the import process. You can find all these features described here: Magento 2 Categories Import Guide.

Magento Import of Categories

Once the extension is installed and enabled, configure the general settings for your import job. Then select the ‘Categories’ entity to import categories to your Magento 2 website from another one. After that, proceed to the import behavior settings, import source, and file format selections.

category import

Don’t forget to map the data if needed. Run the job to see your categories import done. This process is described in detail in the extension’s manual here: Improved Import & Export Manual.

Final Words

Although Magento 2 doesn’t support category import by default, you can get the missing functionality with the Improved Import & Export extension. The module provides the ability to import the entire category tree to Magento 2, using various handy features, such as category mapping. Follow the link below and contact our support regarding the Magento 2 categories import:

Get Firebear Improved Import Magento 2 Extension

Magento 2 Categories Import & Export FAQ

Let’s take a look at other nuances of importing and exporting Magento 2 categories with the help of the Improved Import & Export Magento 2 extension.

How to import and export categories to Magento 2 automatically?

If you need to move categories between Magento 2 and third parties or other Magento 2 websites regularly, use the Improved Import & Export extension. It utilizes a cron scheduler to automate data transfers including category import and export. Create or select a schedule of updates and the module will do everything for you.

How to import categories with third-party attributes to Magento 2?

Although Magento 2 blocks the import of third-party data that doesn’t follow its requirements, you can still transfer unsuitable categories with the help of the Improved Import & Export extension. The module lets you create a mapping scheme where you match third-party attributes and values to ones used within the system. Furthermore, you can apply the same trick to categories: while importing a third-party catalog, show which external categories you want to replace with the ones that are used on your website. Furthermore, you can create new categories and map external ones to them while configuring an import job. As a result, any external data, including categories, is easily adapted to the native standards of your e-commerce website. Note that you can also apply mapping to export processes to generate the output your partners require.

How to import and export categories to Magento 2 via API?

The Improved Import & Export Magento 2 extension provides the ability to create API connections for transferring categories along with other entities. There is a dedicated section in the module’s import/export jobs where you specify the parameters necessary to sync the two systems.

How to import and export categories to Magento 2 via ODS files?

Improved Import & Export lets you move categories via ODS files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import and export categories to Magento 2 via XLSX files?

In addition to ODS, Improved Import & Export lets you move categories via XLSX files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import and export categories to Magento 2 via JSON files?

Also, Improved Import & Export lets you transfer categories via XLSX files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import data to Magento 2 via compressed files?

If your files with categories are compressed, you can transfer them to Magento 2 with the help of the Improved Import & Export extension. Remember that your file archive should be in a ZIP or TAR format. Our module supports compressed CSV, XML, ODS, JSON, and XLSX files.

How to import data to Magento 2 from Google Sheets?

If categories are stored in Google Sheets, it is no longer a problem. The Improved Import & Export extension eliminates the necessity to export them from the service, convert them to CSV, and then transfer the output to Magento 2. Instead of that, you just move the corresponding information straight from Google Sheets to your e-commerce website. It is only necessary to specify the address of the corresponding data table. The corresponding export processes are possible too.

How to import and export categories to Magento 2 from Dropbox?

The Improved Import & Export module lets you move categories to Magento 2 from Dropbox. You can store them there in CSV, JSON, XML, ODS, or XLSX files or ZIP and TAR archives. You can also use this file storage as your export destination.

How to import and export categories to Magento 2 from Google Drive?

In addition to Google Sheets and Dropbox, the Improved Import & Export extension provides the ability to import and export categories between Magento 2 and Google Drive. You can store them there in CSV, JSON, XML, ODS, or XLSX files or ZIP and TAR archives.