How to restore and migrate only product?

We want to only migrate only product. Is that possible?
As we try to import but it keep want us to proceed with the step 1,2,3 but we want to keep the category and product attribute as current since we already modified it.
 
Reimport all the step again will override all our modify category and product attribute.
Any suggestion?
 

32 answers

Profile photo of Mall Staff 184060.00 $tone March 20, 2018
Public

Hi there,

We want to only migrate only product. Is that possible?

Yes, after the first migration with our tool, you could do delta migration in the step #5 only by using one of the CLI commands below:

Run delta migrattion to transfer newly added products only:
php -f bin/ubdatamigration run --step=5
Or run delta migration with ‘update’ mode to transfer both newly created items and all existing Magento 1 products: php -f bin/ubdatamigration run --step=5 --mode=update
IMPORTANT NOTE: the ‘--mode=update’ will overwrite existing Magento 2 data that has been migrated from Magento 1. 

For your additional info via email:

Hi we deleted it from the Magento admin.
Now we restore back the database and we want to only migrate only product. Is that possible?
As we try to import but it keep want us to proceed with the step 1,2,3 but we want to keep the category and product attribute as current since we already modified it.
Reimport all the step again will override all our modify category and product attribute.
Any suggestion?

If you run the delta migration using mode update, your migrated data will be overwritten. 

Regards,
Mall.

#1
Profile photo of Allan Gan 320.00 $tone March 20, 2018
Public

Hi we tried but it show:
 
/var/www/vhosts/i-concept.com.sg/loveluxury2.i-concept.com.sg
-sh-4.2$ /opt/plesk/php/7.0/bin/php -d memory_limit=2G -f bin/ubdatamigration run --step=5 --mode=update
Processing in step #5…
Status: fail
Message: Reminder! Before migrating data in the step #5, you have to complete migration in the step #2
-sh-4.2$

#2
Profile photo of Mall Staff 184060.00 $tone March 20, 2018
Public

Hi there,
I have checked again:

Now we restore back the database and we want to only migrate only product. Is that possible?

Because you reset your database to initial database, therefore I am afraid there is no option to migrate only products.
Please note that, in Magento the products has close relationship with websites, stores, store views, categories, attributes….Thus, in order to migrate products in the step #5, you’re required to migrate data in the step #2,#3,#4 of our tool first. And that is the root of issue you mentioned in your reply #2.
Regards,
Mall.
 

#3
Profile photo of Allan Gan 320.00 $tone March 22, 2018
Public

Hi we remigrate the product without issue. But now we have another issue when want to update the product.
It show No such entity with id = 70

#4
Profile photo of Mall Staff 184060.00 $tone March 22, 2018
Public

Hi there,

But now we have another issue when want to update the product.
It show No such entity with id = 70

I need a closer look to detect the root of the issue as you mentioned. Let’s provide me the information as followings:
+ Admin credentials and back-end url of your Magento2 instance
+ SSH credentials and web root path to Magento2 folder
+ A product’s SKU with the issue as you mentioned
I will help to check further and reply you more later.
Regards,
Mall.

#5
Profile photo of Mall Staff 184060.00 $tone March 22, 2018
Public

Hi there,

I have checked your Magento 2 instance and see a strange issue: 
I see you have finished data migration in the step #5, and our tool detected that you have a total of 1,065 products in Magento1’s database:
http://i.prntscr.com/3nNjor_xTkC_2kdSnDEL6Q.png
And out tool was migrated 1065 products: http://i.prntscr.com/WsuxhGteRWei6-TpRUK5qQ.png
But I see only 273 products in your Magento 2’s back-end grid view now: 
http://i.prntscr.com/b30TXF9kR56icG1J1eO0tg.png
Please let me know if you made any change after completing data migration in the step #5 of our tool?
Also, I see you have used a lot of third-party extensions in your instance now. Could you temporarily disable those extensions for testing with migrated data first?
Once knowing in more details, I will help to check further and get back to you then.
Regards,
Mall.
 

#9
Profile photo of Allan Gan 320.00 $tone March 22, 2018
Public

Hi The migration is completed previously with 1065 products without any issue.
You saw 273 products now because we deleted most of the no needed products already.
I think this will not affect the product right?
We still can update the product through the bulk edit in the product list. but if you edit any of the product inside the product detail edit page, it will show the message “No such entity with id = 70”.

#10
Profile photo of Mall Staff 184060.00 $tone March 22, 2018
Public

Hi there,

Hi The migration is completed previously with 1065 products without any issue.
You saw 273 products now because we deleted most of the no needed products already.

You shouldn’t do that if you plan to do delta migration in the step #5 of our tool after your first migration.

I think this will not affect the product right?

Yes, if you only deleted some migrated products, this action will not generally affect the issue as you mentioned.
As per my first reply #9, I see a lot of third-party extensions. Could you temporarily disable those extensions for testing with migrated data first?
Regards,
Mall.

#11
Profile photo of Allan Gan 320.00 $tone March 22, 2018
Public

Hi we are not planning to do the delta as we just want the 1 time product migrate.
We do not want to remigrate the product again as we already clear the un-needed product.
Can we just focus on how to allowed product update without the error code?

#12
Profile photo of Mall Staff 184060.00 $tone March 22, 2018
Public

Hi there,

Can we just focus on how to allowed product update without the error code?

 I helped to check in the Magento’s log in your Magento2 instance and saw only the general error message below:

[2018-03-22 04:49:37] main.CRITICAL: No such entity with id = 68 {“exception”:”[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with id = 68 at /var/www/vhosts/i-concept.com.sg/loveluxury2.i-concept.com.sg/vendor/magento/framework/Exception/NoSuchEntityException.php:49)”} []
[2018-03-22 04:51:35] main.CRITICAL: No such entity with id = 70 {“exception”:”[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with id = 70 at /var/www/vhosts/i-concept.com.sg/loveluxury2.i-concept.com.sg/vendor/magento/framework/Exception/NoSuchEntityException.php:49)”} []

It is hard for me to detect the root of issue.
As mentioned earlier, could you temporarily disable those extensions for testing with migrated data first?
Regards,
Mall.

#13
Profile photo of Mall Staff 184060.00 $tone March 22, 2018
Public

Hi there,

Hi all the mentioned extension is disabled.

I need more time to check further in your instance about that issue.
Please provide me more the phpMyadmin credentials if you have this.
Regards,
Mall.

#19
Profile photo of Mall Staff 184060.00 $tone March 23, 2018
Public

Hi there,

Hi is there anyway we can unassigned all the products to any category?
so we can assign a new category to each product again?

You simply only delete the relation of your products with none exists categories. You could use the SQL statement as followings to delete that records in the table catalog_category_product:

DELETE FROM `catalog_category_product` WHERE `category_id` NOT IN (SELECT `entity_id` FROM `catalog_category_entity`)

Once done, let’s re-index your data and clean the Magento cache. And re-check the issue on editing products.
And tell me know how it goes.
Regards,
Mall.

#23
Profile photo of Allan Gan 320.00 $tone March 23, 2018
Public

Hi so to double confirm that I just need to execute below query where it will delete only the relation of the non-exist product category to a specific products only right?
 

DELETE FROM `catalog_category_product` WHERE `category_id` NOT IN (SELECT `entity_id` FROM `catalog_category_entity`)
#24
Profile photo of ubdev Staff 98030.00 $tone March 23, 2018
Public

Hi Allan, 

it will delete only the relation of the non-exist product category to a specific products only

Yes, that’s right. 
However, please make sure you back up full database before running such SQL query. 
Regards,
Ubertheme team

#25
Profile photo of Allan Gan 320.00 $tone March 23, 2018
Public

Hi we delete the category assigned to all the product.
Below is the table we truncate all the data. We already reindex the product.
So now all the product is not assigned to any category, but the same warning still showing.
No such entity with id = 68
catalog_category_product
catalog_category_product_index
catalog_category_product_index_replica
catalog_category_product_index_tmp
 

#26
Profile photo of Mall Staff 184060.00 $tone March 23, 2018
Public

Hi there,

 Hi you can try to assign a product to category example Designer or Collection.
Then you will see the issue.

I have re-check and see that related to your categories tree. I see you have deleted a lot of categories after migrated and I see you have a lot of custom settings on categories. How did you deleted some your categories after migrated in first time?
In product edit page, if you switch to the store view ‘English’, you will save your product successfully.
Regards,
Mall.

#29
Profile photo of Allan Gan 320.00 $tone March 23, 2018
Public

After we first time migrate, then we just delete the usual category and products from the magento admin.
We are not delete it from database or any command line.

#30

Please login or Register to Submit Answer

Written By

Comments