Magento 1 will soon reach its end-of-life. For many webshop owners, this is an opportunity to consider other e-commerce platforms. One of these platforms is Shopware 6. Shopware 6 was launched last January, and is extremely fast, stable and user-friendly. If you are considering a switch, this is also an excellent time to get all of your product information in order.
In this blog post, guest author Michel Doens, owner of Shopware Enterprise Partner Sition, provides a step-by-step explanation of how to make the switch from Magento to Shopware with Akeneo PIM. The switch from Magento to Shopware is not difficult, but does require proper preparation.
Export your product data from Magento 1
First, you must export your product data from the current Magento 1 environment according to the step-by-step plan below
- Check whether you actually want to include all products in the migration. The better you clean up the data now, the less work down the road!
- Go to “System” -> “Import/export”.
- Select “Products” & “CSV”.
- Select any attributes that you do not want to export.
- Click “Continue”. You have now created and downloaded a product file.
- Use SFTP to log into the Magento 1 environment. Next, navigate to the media/catalog/products folder and download its contents. You will soon need to upload these contents to Akeneo.
You can also export the categories using various plug-ins. This is not required because the above product export also includes a “category” field. It is quick and easy to link these products to a category in Akeneo in the “bulk” editor.
Export your product data from Magento 2
If you want to export your product data from Magento 2, we recommend using the Firebear improved & export plug-in. This plug-in exports more data (attributes and categories) than the standard Magento 2 import/export function.
Use this plug-in to export the following data:
- This export also contains the “Attribute options”
To export the data with the standard Magento 2 function, proceed as follows:
- Go to “System” -> “Export”.
- Select “Entity type”: products.
- Select “CSV”.
- Check the “Fields enclosure” box.
- Next, check the boxes for the attributes you DO NOT want to export.
- Click “continue” at bottom.
Magento 1 & 2 data processing
Before you can import products into Akeneo, you must first configure the PIM system. To do this easily and efficiently, it is a good idea to familiarize yourself with the terms described below.
|Akeneo||Magento||Shopware 5||Shopware 6|
|Attribute group||[ drag-drop in editor ]||[ not available]||[ not available]|
|Family||Attribute set||Property Group||[ not available]|
|Product||Product||Items / Products / Articles||Product|
|Product (variant)||Simple Product||Variant as part of Product||Variant as part of product|
|Product Model||Configurable product||Main product||Product|
|Product (variant)||Simple product||Variant of product||Variant of Product|
|Groups||[ not available]||[ not available]||[ not available]|
|Group types||[ not available]||[ not available]||[ not available]|
|Locales||Locales||Locales / Languages||Locales / Languages|
|Channels||Website / Storeview||Shop / Sub-shops||Sales Channels|
Note on Shopware 5 attributes
For many entities, Shopware 5 also has free fields and attributes such as “customers”, “products” and “categories”. These are handy for storing additional data.
However, these free fields behave a bit differently from attributes as we know them in Magento. In Shopware 5, these are mostly text fields, but you can also set these fields as filters that are not visible by default. Only the attribute 1 & 2 fields are visible by default for a product. The others can be made visible by editing the template.
Note on Shopware 6 free fields
Shopware 6 also has free fields (“customers”, “products” and “categories”) for the same entities.These are handy for storing additional data, but are not yet usable as filters or visible in the theme.
Before the import into Akeneo, the following files must be prepared:
- Category import.csv: file with all categories [optional]
Categories can also be created directly in the PIM system. This file is not strictly necessary.
- Attribute import.csv: file with all attributes and/or description of the characteristic, such as “color”
Please note that prices are imported as “price”, not as “number”. The attribute type should be “pim_catalog_price_collection”.
- Attribute option import.csv: file with all attribute options, such as “green” and “blue”
If the attribute is of the “select” or “multi-select” type, it works a bit differently. One example here would be “color”, where all colors must be defined first. Other attributes such as “text”, “number”, “price” or “text area” must also be defined as options.
Making lists of all of these options involves a fair amount of work. As a standard, these options must be imported into Akeneo first. Fortunately you can skip this step by using an Akeneo plug-in that automatically creates the options during importing. The Akeneo attribute options are automatically created using the Akeneo Auto Attribute Bundle plug-in.
- Attribute group import.csv: clusters attributes such as prices, metadata, etc.
This promotes user-friendliness for the PIM system. [optional]
- Family import.csv: file with attribute sets
This file indicates the attributes that belong in an attribute set. If a “configurable” attribute is used, such as color or dimension, it must appear in both family import and family variant Import.
- Family variant import: file that records the relationships between the simple and configurable attributes by family and/or attribute set. Example: dimension/color
Information on composing this file is available in the Magento column: “configurable_variations”. The attributes indicated here should end up in a “family” for each attribute set. In addition, the underlying products that can be linked as variants are available for each “product model” and/or “configurable product”.
For all of these linked products, the “parent” column must be filled in with the “SKU” of the configurable and/or the main product. This is a time-consuming process. The Firebear Improved Configurable Export for Magento 2 can offer a solution here. For Magento 1, this module is not available and involves manual or programming work.
- Product model import: file with all configurable products (main products)
Product model is a file with all configurable products. This file is relatively easy to make by filtering the Magento product file by “product_type” = “configurable”. Only save these products to this file.
- Product import: file with the “normal” and/or “simple” products and/or variants
This file includes all “simple” files. This file is relatively easy to make by filtering the Magento product file by “product_type” = “simple” or “downloadable”.
Not supported by Akeneo
“Bundle” or “Grouped” products are not supported and will have to be created in Shopware 6.
You can find samples of the import files described above on the GitHub page of Sition
Import products into Akeneo
For each of the 8 files above, an import profile must be created in Akeneo. Before we can get started with this, the requirements below must be met.
- Akeneo v3.x is installed (NOT v4: the interfaces are not available for it yet!)
- You have access to the server and can use SFTP to upload files
- Demo data is NOT installed
- Settings -> Currencies: EURO is enabled here
- Settings -> Locale: at least “en_US” is enabled here
- Settings -> Channels: at least 1 “Ecommerce” channel is available
Create import profiles and importing them
- Go to Import -> Create new import profile
- Enter code: “sw6_category_import”
- Enter label “1. Shopware 6 category import”
- Select “job” -> “Category import in CSV”
- Click “save”
- Click “upload a file”
- Select “Category import.csv” on your PC
- Select “upload & import now”
- You will see “Status: Starting”. The file is being imported. Note: if the status stays on “Starting” for too long, the “cronjob” or “daemon” that starts the import process is not yet activated
- The job can also be started manually by entering the following command in the command line: “php bin/console akeneo:batch:job-queue-consumer-daemon –env=prod”.
- After importing, go to “Channels” -> “Ecommerce” and select this channel.
- Go to “Properties” -> “Category tree”, link the category tree just that was imported to this channel by selecting “Default Category” and then click “save”.
- Repeat steps 1 to 8 for files 1 to 5.
- Product model import: images should also be imported here. We are now not working with a file that we upload in the browser. We upload all images and the product model.csv file with SFTP to a folder on the server.
- Use SFTP to log into the server and create an “upload” folder in the home folder of the user,for example: /home/pim02/upload.
- Upload the “media” folder found here: https://github.com/SitionNL/akeneo_import_example_shopware (the repository is downloadable as a ZIP). A /home/pim02/upload/media folder is now available as well, containing subfolders and images.
- Enter code: “sw6_product_model_import”.
- Enter label “7. Shopware 6 product model”.
- Select “job” -> “Product Model import in CSV”
- Click “save”.
- Click on the “global settings” tab.
- For the path, enter the complete path for file “7-m2sample-Shopware6-product_model-configurable_import.csv” to the folder just created in step 15.
- Click “save”.
- Click “import now”.
- Repeat steps 17 to 24 for “product_import”.
Now that we have completed these steps, the PIM is filled with Magento 2 demo data for the import to Shopware 6.
Connect Akeneo to Shopware 6
Now that all products and categories are in Akeneo, we can start interfacing. We use the Webkul plug-in for this. The plug-in was recently developed and is highly useful, although some points for improvement do remain for a subsequent version (after March 2020). We discuss the details here. We assume you are following the installation instructions in the manual. In addition to the Akeneo plug-in, a Shopware plug-in must also be installed to upload pictures to Shopware.
One point that lacks clarity in the manual: you must first transfer data from Shopware 6 to Akeneo and link the data to the products before you can export from Akeneo.
How does this work?
- First link or “map” the following fields to the attribute. You can do this at Shopware 6 connector -> set attribute mapping
- The other fields are self-explanatory. Please note that yes/no options are used as true/false values
- Attention to prices: the connector expects a net (before VAT) and gross (after VAT) price. At this time, the connector cannot copy the prices from the different prices. Please note that you are linking a price field that is linked to the “product model” and not to the variant
- It is possible to import additional Shopware fields. You can use the following fields as “Shopware Standard attribute code (required)”:
- ean – Varchar(255)
- active – Tinyint(1)
- manufacturerNumber – Varchar(255)
- isCloseout – Varchar(255)
- availableStock – Int(11)
- available – Tinyint(1)
- purchaseSteps – Tinyint(1)
- restockTime – Int(11)
- height – Decimal(10,3)
- width – Decimal(10,3)
- referenceUnit – Int(11)
- purchaseSteps – Tinyint(1)
- releaseDate – Datetime(3)
- Import the data from Shopware 6 to Akeneo. You can do this in imports: see instructions below
- Use the Bulk editor function in Akeneo to link the appropriate fields to the products
1. Import data from Shopware 6 to Akeneo
Sales Channels folder: sw6_sales_channel, import job: Sales import
Tax IDs, folder: sw6_tax_id, import job: Tax import
Manufacturers folder: sw6_manufacturer, import job: Manufacturer
Delivery time folder: sw6_delivery_time, import job: Delivery time
Scale units folder: sw6_delivery_scale, import job: Scale
2. Import the Shopware 6 fields
- Go to “Import”
- Click “create import profile”
- Code: sw6_delivery_scale, job: sw6_delivery_scale
- Job: ShopWare6 connector > Scale import
- Click “import”
- Repeat this for all import jobs from 1 to 5 indicated under step 1
3. Bulk editor
Now that all Shopware 6 fields are filled in, it is time to fill in the fields with the Akeneo Bulk editor. The Bulk editor is a highly useful function in Akeneo.
- Go to the product list in Akeneo
- Apply the filters to filter all comparable products
- Click the checkbox next to 1 product. At the very bottom of the page, a small but important arrow will now appear. This lets you select “all” products
- Next, click “bulk actions”
- Click “edit attribute values”
- Click “next”
- Select the aforementioned attributes “sw6_sales_channel”, “sw6_tax_id”, “sw6_manufacturer”, “sw6_delivery_time”, “sw6_delivery_scale”.
- Click “add”
- Click “next”
- Enter the attributes
- Click “next” and “confirm”
Import products into Shopware 6
Now that the products in Akeneo have the required Shopware 6 data, the interface can be created. Please note that the price fields have also been filled. In this version, you must enter both the net and gross prices. Unfortunately this does not make sense, but is still required. You can do this by adding the correct price columns to the product import file and re-importing it.
- Go to “Exports”.
- Click “create Export profile”.
- Enter code “sw6_export_all”, label “export all to Shopware 6”.
- Select job “Export all to Shopware 6”.
- Repeat steps 1 to 4 for all individual exports to Shopware 6 so you do not have to export everything each time, but can also export in parts. This is faster particularly for minor changes. Moreover, the individual tasks can also be automated here.
- Start the “Export all to Shopware connector”.
- Strange but true: we have noticed that it is better to do all individual exports first in the following order: category, attributes, product models, products.
Verify products in Shopware 6
Now that the products and categories have been imported, you can find the products and categories in the Shopware backend. Unfortunately you still cannot see anything on the frontend, or the thumbnails. To resolve this, you must take the following actions:
Set the categories
- First link the new category tree to the desired Sales channel. You can do this by opening the Sales channel in the left side bar and selecting the main category of the new category tree in “Entry point of main navigation”.
- After this, the categories still need to be enabled.
- Go to “Catalogs” -> “Category”.
- Open each category one-by-one, enter a short description, change the type to “Category” and save it.
- If everything went well, you can still open the webshop and see the categories and products, but still without ‘cover image’. By default, the cover image is not set yet after import. You can do this using Shopware. To save some time, we opt for a method using a database query. We choose to set the first picture as the cover image.
set product.cover = (select id from product_media where product.id = product_media.product_id and product_media.position =1 ), product.product_media_id = (select id from product_media where product.id = product_media.product_id and product_media.position =1 )