How to Import XML Files to Shopware 6

- Our extensions, Shopware

By default, Shopware 6 requires CSV files to import data to your e-commerce website. But what if your update is available in an XML file? You need to convert it to CSV and then run an import procedure. However, there is a more convenient way to update your Shopware 6 website without this conversion. Meet the Improved Import, Export & Mass Actions application for Shopware 6. This extension fully supports XML files for both import and export processes. In the following article, you will learn how to import XML files to Shopware 6. But before going any further, let’s see what’s the difference between CSV and XML. And don’t forget to check our Shopware Cookbook for more useful recommendations. 

CSV vs. XML

A CSV (comma-separated values) file is a text file where commas are used to separate different blocks of data.

An XML file introduces a little bit more complex approach to storing and transferring data. It is an extensible markup language file that adds tags and text to structure data. These tags adhere to specific syntax guidelines. They surround the text in the file that you wish to store. 

The difference between CSV and XML file formats is that CSV format is a plain text format in which values are separated by commas (Comma Separated Values), while XML uses tags to represent relationships between entities and store data about complex objects. 

CSV is highly convenient and requires fewer technical skills. Additionally, it is significantly smaller than XML, meaning that less processing power and other resources are required. 

XML, in turn, is a more flexible and extensible format suitable for storing and exchanging complex, structured data. 

How to import XML files using the default Shopware 6 tools

There is only one way to import XML files using the default Shopware 6 tools. You need to convert XML to CSV. Check this XML to CSV converter or this XMLGrid instrument. Upload your XML file and convert it into CSV.

Next, export a sample CSV file from your Shopware 6 website and compare it with the converted one. If there are any inaccuracies in the converted CSV file, fix them. Otherwise, you won’t be able to import the necessary data to your e-commerce website.

How to import XML into Shopware 6 without conversion

However, there is another way to import XML files to Shopware 6. You need the Improved Import, Export & Mass Actions app. The latest release of this tool adds support for XML file import. And it requires no additional actions. Go to Extensions -> Improved Import, Export & Mass Actions -> Product Import. Click the New Profile button.

shopware 6 xml import

The Select file screen is a place to choose XML as your file format. Follow these steps to make Shopeare 6 XML import possible: 

import xml to shopware

  1. Name your profile; 
  2. Select an entity you want to import (e.g., products or customers);
  3. Create a schedule of updates;
  4. Configure email notifications;
  5. Select XML as your file type (alternatively, you can choose CSV or XLSX);
  6. Choose an import source (e.g., file, URLFTP, Google Drive, or Google Sheets);
  7. Configure advanced settings that include URL rewrite behavior, media replacement behavior, and stock increment strategy

Next, you can proceed to the mapping screen. Specify which columns from the imported file match the properties of the products from your Shopware 6 store. 

Note that the app lets you preview how products will look before you import them. When you click the Import button at the bottom of the Preview result page, the extension imports your XML file.

XML File Structure

Also, note that your XML file structure should be organized as follows:

Where column names (attributes or properties) are stored between <item> and </item>.

import xml with the following structure

You can read more about the enhanced Shopware 6 import in our Improved Import, Export & Mass Actions Manual.

Other Features

The initial release of Improved Import, Export & Mass Actions addresses the most common issues Shopware 6 store owners face upon import and export processes. First of all, it is editing products in bulk as a single page. Unlike the default procedure, the app exports all product attributes in a single file instead of multiple separate files for different properties. Below, you can see some of its core features:

  • Full product import and export with custom properties (attributes);
  • Customer import and export with addresses;
  • Orders export;
  • Full support for product variants with a full set of attributes;
  • Product properties mapping and mapping presets;
  • Import and export schedules;
  • Support for CSV, XLSX, and XML file types;
  • Direct file uploads;
  • FTP/FTPS uploads.

You can find more information about the product here: