The error occurs if there are orders in the Magento 1 database with no increment_id
set. You can check if you have such orders by running the following SQL statement in your Magento 1 database:
select count(*) from sales_flat_order where increment_id = '' OR increment_id is NULL;
If the returned value is greater than 0, you should update the tables sales_flat_order
and sales_flat_order_grid
in such a way to ensure that all your orders have increment_ids and those are unique.
If you find incrment_ids
in the sales_flat_order_grid
table for all orders, just take the values from there with the following statemen:
update sales_flat_order o
join sales_flat_order_grid g
on o.entity_id = g.entity_id
set o.increment_id = g.increment_id
where o.increment_id = '' OR o.increment_id is NULL;
If you don't find orders without any increment_id it might be the best option to create arbitrary increment_ids. For example you can use a SQL update statement which builds an increment_id
based on the entity_id
and a prefix of your choice (just replace the prefix in the sample statements with something which doesn't conflict with existing increment_ids):
update sales_flat_order set increment_id = concat ('990000', entity_id) where increment_id is null;
update sales_flat_order_grid set increment_id = concat ('990000', entity_id) where increment_id is null;
sales_flat_order
in your Magento 1 database.entity_id
butincrement_id