Blog Posts

Update existing products with bulk import

Update existing products with bulk import

Update existing products with bulk import

In the last blog, I shared the steps to create bulk import in Magento and in this article, I am going to explain the process to update existing products.

Here we go!

1) Begin import session with a profile & running mode; here profile is “default” & running mode is “update”. There are other available modes also i.e. “update” updates only, “xcreate” creates only.

For values other than “default” profile has to be an existing Magmi profile.

Add these lines in your script.

$dp = Magmi_DataPumpFactory::getDataPumpInstance(“productimport”);
$dp->beginImportSession(“default”, “update”);

2) Magmi profile: Create a Magmi profile with “Demo_Update” and select the options. Here is an example of Column Mapper for update:

3) Example:



$products_full_file = “products_full.xml”; // local xml file name
$products_url = “”; //live link of products XML file
$update_profile = “Demo_Update”; //magmi profile name

$filexml = file_put_contents($products_full_file, fopen($products_url, “r”));
$products = simplexml_load_file($products_full_file);

$total_products = $products->count();

$dp = Magmi_DataPumpFactory::getDataPumpInstance(“productimport”);

for($rows = 1 ; $rows < $total_products; $rows++){
$product = $products->product[$rows];
$product_sku = $product->productCode;
$price = $product->price;
$stock = $product->stock;

if(product_exists($product_sku) == 1)
$fields = array(
“Number” => $product_sku,
“Stock” => $stock,
“Price” => $price


4) The above code is to update stock and price of the existing products. You can update special price, images, title description or any attribute which you want to update in bulk.

So, the shared steps will be a proven methodology to update products in a short span of time instead of following a manual lengthy approach.

Found the article useful? Share it with your friends and co-workers… Now!

« Previous Post

How to create a Custom Module in Magento2

Next Post »

How to add custom field in Contact Us form in Magento2?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.