Magento 2 MSI User Guide: How to Import & Export Magento 2 MSI (Multi Source Inventory)

- E-Commerce, Magento 2

Magento 2 MSI User Guide

This Magento 2 MSI user guide briefly explains the platform’s multi-source inventory functionality and then focuses on the Magento 2 MSI import and export. Magento 2.3 came out with the long-awaited Multi-Source Inventory (MSI) support. The feature is available right after you install the Magento 2 MSI module. Although the extension dramatically improves the basic experience associated with inventory management, it still lacks various vital functionalities, especially in data synchronization. Luckily, you can always address the existing issues with the help of third-party solutions. Regarding the Magento 2 MSI module and data transfers, the Improved Import & Export extension and its MSI add-on are at your service. 

In this blog post, you will learn how to import and export all Magento 2 MSI entities: sources and quantity of the products per source. Firstly, we describe the MSI module and explain how to install it. After that, you will find out what to do with the MSI add-on of the Improved Import & Export extensionNext, we focus on the Magento 2 MSI import. The article explores the CSV formatting of MSI entities used in Magento 2. You will learn how the stock sources MSI table works and what to do with the stock sources qty MSI tableThe last chapter of this Magento 2 MSI import/export guide describes how MSI source import/export works

What is Magento 2 MSI?

Magento 2 MSI is a multi-source inventory management system. This system allows you to allocate product stock per warehouse, and decide from which warehouse the product should be shipped to the customer. If you are using multiple warehouses to store your products – this feature is a must for your Magento 2 store.

Before Magento 2.3 release the MSI functionality could have been added to your store using third-party extensions. We have already discussed such third-party extensions in the article here. If you are looking for the full picture of Magento 2 MSI, or want to replace the native MSI functionality you may want to read it.

Read how to work with MSI functionality

In this article, however, we will talk about how to import and export Magento 2 MSI entities, namely sources and product quantity per source.

Magento 2 MSI Import & Export Prerequisites

To import and export MSI sources and product quantity you need the Improved Import and Export extension with MSI Add-On installed. Improved Import and Export is a full-featured Magento 2 extension operational from both the administrator panel and command line.

The extension covers almost all Magento 2 entities import and export and comes with the following features:

  • Import and export of products, categories, CMS blocks and pages, orders, cart price rules, customers, product attributes, and advanced pricing.
  • Import and export of all Magento 2 B2B entities: companies, shared catalogs, requisition lists, quotes, and negotiable quotes.
  • Support multiple file formats including CSV, XML (with XSLT templates), Excel XLSX, OpenOffice ODS, and JSON.
  • Support of Google Sheets – import CSV files by pasting Google Sheet links.
  • Support of REST and SOAP API connections to different software.
  • Price adjustments.
  • Category mapping.
  • Custom logic and many more. Read the full feature list on the extension product page.

That’s pretty much it, you only need to have the Improved Import and Export extension installed. The extension comes with an explicit user manual, sample files, and extensive guides on every entity. Additionally, the Firebear team composed a sample Google Sheet Master Table and B2B Master Table for you with every attribute described and sample values assigned.

Install a Magento 2 MSI Module

Before installing the MSI add-on for the Improved Import and Export extension, you need to install the MSI extension for Magento 2.

Installation instructions written by the Magento team can be found here.

Enable Magento 2 MSI

Follow these steps to enable Magento 2 MSI:
  • Go to Stores > Inventory > Stocks.
    how to find magento 2 msi
  • You will see the Default Stock on the Manage Stock page. It cannot be disabled.
    The default stock is assigned to the default source and the main website if you use a Single source mode.Magento 2 MSI default stock
  • Click the Add New Stock button to add a new stock source and enable the multi-source mode.
    add new stock to enable magento 2 msi

Install MSI Add-On for Improved Import and Export

NOTE: Before installing MSI Add-On make sure you have installed the Improved Import and Export extension.

  1. Navigate to your store root folder in the SSH console of your server:

  2. Install MSI Add-On by running this command:

  3. Enable MSI Add-On by running:

  4. Deploy content and flush store cache, log out from the backend, and log in again. Run:


    and:

Congratulations, you have installed MSI Add-On for Improved Import and Export extension.

Table Formatting of Magento 2 MSI Entities

Two MSI entities are available for import and export: Stock Sources and Stock Sources Qty.

As you can see, these entities are pretty simple and should be easy to get into if you have ever worked with MSI functionality. Anyways, before you proceed we advise reading through the attributes of both entities to understand which values are required and can be used for different settings.

Stock Sources Magento 2 MSI Table

Stock Sources are the warehouses you create at Stores > Inventory > Sources.

Magento 2 MSI User Guide: manage sources screen

Here you can add new Magento 2 MSI sources. The required attributes are:

  • Name – the name of a warehouse;
  • Code – the code of a warehouse used for internal identification purposes and serves as a reference when assigning product quantity;
  • Country – the country of a warehouse location;
  • Postcode – the postcode of a warehouse region.

The rest of the attributes are optional. When creating warehouses using the import procedure make sure to at least provide information for these attributes, otherwise your Magento 2 store won’t be able to create a warehouse.

Having explored warehouse creation from the administrator panel gives a better understanding of all the attributes in the import and export tables. Before proceeding to compose an import table or gathering data for it, make sure to experience manual warehouse creation.

Below you will find all Stock Source attributes available for import and export. For reference, we suggest opening an MSI Stock Sources sample table in a separate tab of your browser.

Attribute Name    Reference Values Value Example
source_code Code of the warehouse. Is used for identification purposes. Can be up to 64 Latin characters in length, without spaces, and can contain “-“, “_”. my_warehouse
name Name of the source Can be any value My First Warehouse
enabled Defines if the source is enabled 1 – enabled

0 – disabled

1
description Description of the source Can be any value This is my first warehouse
latitude Latitude of the source location Can only be a geographic latitude value 123.12
longitude Longitude of the source location Can only be a geographic longitude value 321.32
country_id ID of the Country of the Source Address Data Can be only the country code ID of the Magento variant of ISO 3166-1 AT
region_id ID of the Region of the Source Address Data Can be only the Region code ID of Magento region codes 95
region Region of the Source Address Data Can be any value – a text field. Doesn’t work with IDs. Moscovia
city City of the Source Address Data Can be any value New York
street Street of the Source Address Data Can be any value Street st.
postcode Postcode of the Source Address Data Can contain only numerals 12345
contact_name Contact Name of the source Contact Info Can be any value John Doe
email Contact Email of the source Contact Info Can be only email value john@doe.com
phone Phone of the source Contact Info Phone number +123123123
fax Fax of the source Contact Info Fax number +123123123
use_default_carrier_config System attribute of the source with no particular use case in setting up a new source
carrier_links System attribute of the source with no particular use case in setting up a new source

NOTE: When creating Stock Sources using import jobs, make sure to provide information for the attributes: name, source_code, country_id, and postcode. These attributes are required by the Magento 2 system to create new warehouses. Without them, a warehouse cannot be created.

Stock Sources Qty Magento 2 MSI table

The Stock Sources quantity is applied at the product level once the warehouses are assigned. To check the quantity per warehouse navigate to the product of interest.

Magento 2 MSI User Guide: sources assigned to a product

In the screenshot above, you can see that we have two warehouses new-warehouse and old-warehouse. Both are assigned to a single product, and this very product has stock in both warehouses. When managing order shipping you will be allowed to decide from which warehouse you want to send the item.

Below you can see all Stock Sources Qty attributes available for import and export. For reference, we suggest opening an MSI Stock Sources sample table in a separate tab of your browser.

Attribute Name    Reference Values Value Example
source_code Code of the warehouse. Is used for identification purposes. Make sure to specify the exact code value. The code is used to tie product stock to a source. my_warehouse
sku SKU of the product whose stock is tied to a particular source (warehouse) Can be up to 64 Latin characters in length, without spaces, and can contain “-“, “_” TST-01
status Source Item Status. Defines if the products in a particular source are in- or out-of-stock. 1 – in stock

0 – out of stock

1
quantity Quantity of products in a particular stock (warehouse) Can only contain numerals 123

NOTE: if your product belongs to several stock sources (warehouses), you need to have a dedicated row for every warehouse in the import table. For example:

Magento 2 MSI User Guide: Sources per product with QTY

As you can see in the screenshot above, we have three warehouses:

  • new-warehouse
  • old-warehouse
  • default

And four products:

  • 24-MB01
  • 24-MB02
  • 24-MB04
  • 24-MB06

All these products belong to all three warehouses. That’s why every product has a separate row for every warehouse. When importing such files, the product quantities per warehouse are imported in the order they appear in the file.

How to Import & Export Products with Multiple MSI Warehouses

With the 3.5.2 release of Improved Import & Export, you can now import products and assign them to multiple warehouses with the Magento 2 MSI functionality enabled.

Improved Import & Export for Magento 2 allows you to specify:

  • To which warehouse a product is assigned;
  • The quantity of a product at a particular warehouse
  • If a product can be purchased from the specific warehouse

To import products to Magento 2 with the warehouse reference you need to add three custom attributes to your product import file:

Attribute Name Reference Values Value examples
msi_{warehouse_name} Allows you to assign an imported product to a particular warehouse.

{warehouse_name} should be replaced by the name of the warehouse you want to assign the product.

Possible attribute values are:

1 – the product is assigned to a warehouse

0 – the product is not assigned to a warehouse

1
msi_{warehouse_name}_qty Allows you to specify a product quantity available at the particular warehouse.

{warehouse_name} should be replaced by the name of the warehouse you want to assign the product.

Only numeral values are allowed 123
msi_{warehouse_name}_status Allows you to specify if the product can be purchased from the specified warehouse.

{warehouse_name} should be replaced by the name of the warehouse you want to assign the product.

Possible attribute values are:

1 – the product can be purchased from a warehouse

0 – the product cannot be purchased from a warehouse

1

When exporting products with multiple warehouses, the Improved Import & Export extension for Magento 2 automatically adds these three attributes to the exported file.

You can use multiple msi_{warehouse_name}, msi_{warehouse_name}_qty, msi_{warehouse_name}_status attributes to assign a product to multiple warehouses.

You can use a sample Master Table to see how these attributes can be used during the product import.

See the extension’s manual to learn how to import products to Magento 2.

Magento 2 MSI Source Import & Export

Below, you will find an example of how to export the MSI source from Magento 2 and how to import it back to Magento 2 with a new source included. The screenshots are taken from the Improved Import and Export extension which is different from the native Magento 2 import/export tool.

Please refer to the Improved Import and Export extension manual for explicit instructions on how to use every feature of the extension. The following chapter illustrates only a particular episode to provide an idea of how Improved Import works. It doesn’t cover every feature of the extension and doesn’t provide step-by-step instructions.

For reference, you can use the Firebear demo store in a separate browser tab.

How to Export Magento 2 MSI Stock Sources

You can export Magento 2 stock sources associated with the MSI module as follows:

  1. Navigate to System > Improved Import/Export > Export jobs. At the export jobs grid, you will see all already created jobs.
    Magento 2 MSI User Guide: add new export job
  2. Click the Add New Job button to create a new export job. You will be redirected to the job settings screen.
    Magento 2 MSI User Guide: automate export
  3. In the General Settings, specify the export job name and set a required frequency if you plan to schedule the job to run automatically. Scroll down to the Export Settings section.
    Magento 2 MSI User Guide: export settings
  4. Select ‘Stock Sources’ from the Entity drop-down and proceed to the Export Behavior.
    Magento 2 MSI User Guide: export behavior
  5. Select a file format from the File Format drop-down and change separators if necessary.
  6. Scroll down to specify the place to where you want to export the stock sources. For instance, you can specify the path to the file with the file name(don’t forget the file format). You can also add a current timestamp to the file name automatically.
    Magento 2 MSI User Guide: export source
  7. Now click the big orange ‘Save & Run’ button at the top right corner of the screen to execute the export job and get a file with Magento 2 MSI stock sources.

How to Import Magento 2 MSI Stock Sources

First, let’s add another stock source to the file we have just exported. If you have been exporting stock sources to the CSV format the best way to edit it is to use Google Sheets. Excel and OpenOffice tend to adjust CSV files so it is better to use Google Sheets.

Editing Magento 2 MSI Stock Sources CSV

Your exported file with MSI stock sources looks as follows:

Magento 2 MSI User Guide: MSI Stock Source CSV

Sample Google Sheet stock source table

From the columns A source_code and B name, we can see two sources:

  • Default Source with the code default
  • Old Warehouse with the code old-warehouse

To add a new source you will need to another row with source information. Let’s complete row 4 with the following information:

  • New Warehouse (warehouse name)
  • US, Texas, postcode 12345 (address)
  • The contact person is John Doe, phone +123123123, email john@doe.com (contact)

Now we need to get this information into the table we have. Using the attribute table from this blog post, you can find all the required attributes to fill in this information as follows:

Magento 2 MSI User Guide: stock source table

The only thing we have to come up with is the source_code attribute value for the new warehouse. Think of it the same as product SKU, this is a unique identifier of the stock source. All other information in row 4 is the same as we had written for the warehouse.

Let’s now import this very table we have edited.

Import Magento 2 MSI Stock Sources CSV

Now, follow these steps to import your MSI stock source CSV to Magento 2:

  1. Proceed to System > Improved Import/Export > Import jobs and click the ‘Add New Job’ button to create a new import job.
    Magento 2 MSI User Guide: new import job
  2. In the general settings, specify the name and schedule if you want to import your Magento 2 MSI stock source regularly.
    Magento 2 MSI User Guide: import automation
  3.  Scroll down to the Import Settings and select the entity you want to import – Stock Sources. Choose Stock Sources QTY to import the quantity update.
    Magento 2 MSI User Guide: import settings
  4. Proceed to the Import Behavior section and choose Add/UpdateReplace, or Delete.
    Magento 2 MSI User Guide: import behavior
  5. Scroll down to the Import Source section. Let’s suppose you have been editing the table in the Google Sheets, so you can paste its URL to the import stock sources to Magento 2.
    Magento 2 MSI User Guide: import source
  6. Once the link is pasted, click the ‘Validate file’ button.
  7. After the validation is complete click the ‘Save & Run’ button at the top right corner of the screen to import your MSI stock source CSV to Magento 2.

That’s it. Once the import is complete you can check your stock sources for the new source.

Magento 2 MSI User Guide: new sources added after import

Please note that it is a simple case of running both import and export jobs. The Improved Import and Export extension has many more settings and offers additional flexibility. To get the full list of features, visit the extension product page or read the Improved Import and Export manual and our Guide List where we give explicit instructions on how to import any entity to Magento 2.

Magento 2 MSI FAQ

Below, we summarize the most important inventory management aspects of Magento 2 in the form of questions and answers.

What is MSI in Magento 2?

As we’ve already mentioned, Multi-Source Inventory (MSI) is a long-awaited feature that first appeared in Magento 2.3.0. The tool provides store merchants with the ability to control their single or multi-channel inventories and sale channels much more efficiently.

How do I turn off MSI in Magento 2?

If you don’t need the revolutionary functionality, it can be disabled with the help of the following command:
php bin/magento module:status | grep Magento_Inventory | grep -v List | grep -v None | grep -v -e ‘^$’ | xargs php bin/magento module:disable
php bin/magento s:upgrade
php bin/magento s:s:deploy -f
php bin/magento c:flush
php bin/magento i:reindex

How do I check inventory in Magento 2?

You can check the Magento 2 inventory only after configuring the corresponding feature. Go to your admin panel and open the ‘Stores’ menu. Choose the ‘Configuration’ option and expand the ‘Catalog’ tab. Here, you will see the ‘Inventory’ section. It provides the ability to manage the Stock Options and Product Stock Options settings.

Does Magento manage inventory?

With Magento Inventory Management, you get tools to manage your product inventory. No matter whether you run a single store or use multiple warehouses, stores, and pickup locations – the corresponding features will help you to maintain quantities for sales and handle shipments to complete orders. With MAgento 2 MSI, you get lots of extra capabilities that let you automate numerous daily tasks.

How do I change the default stock in Magento 2?

You should enable the corresponding functionality to be able to change the default stock in Magento 2:
– Go to your admin sidebar;
– Proceed to Stores -> Settings -> Configuration.
– Expand the Catalog section and choose Inventory.
– In the Product Stock Options section, set Manage Stock to Yes.
– Click Save Config when complete.

What is salable quantity?

Under Salable Quantity, we assume the sum of all available resources grouped in stocks. Note that the quantity of a product does not decrease when the customer places an order. It happens during the next stage.

How do I import Magento 2 MSI data automatically?

If you want to automate data transfers associated with your Magento 2 inventory, you need to install the Improved Import & Export Magento 2 extension and its MSI addon. Both tools let you leverage a cron scheduler. With this tool, you decide within which time frame to launch a corresponding import or export process automatically.

How do I import inventory data to Magento 2 from external systems?

If you need to transfer inventory data from external platforms but it doesn’t follow the Magento 2 requirements, there is no need to edit it manually. The Improved Import & Export Magento 2 module and its MSI add-on let you apply all the required changes right within your admin. The tools let you create mapping schemes, teaching Magento 2 how to react to unknown attributes. After that, the system replaces them automatically, importing inventory data from any external sources.

How do I import inventory data to Magento 2 via API?

If you need to establish an API connection between Magento 2 and any external platform, you can also use Improved Import & export along with its MSI add-on. The tools provide the ability to synchronize the two systems with the help of APIs. Thus, you establish a direct flow of inventory data.

Final Words

Although the Magento 2 MSI import and export processes are not available by default, you can easily get the missing functionality with the Improved Import & Export extension and its MSI Add-on. As you can see from our Magento 2 MSI user guide, the data transfers of both products linked to multiple stock sources and the sources themselves are not rocket science. Everyone can easily run the basic imports and exports. At the same time, you can always contact our support to get more information on how the Magento 2 MSI import and export work. Follow the link below for more information:

Get Improved Import & Export Extension