Getting Error on Import Products in UB Migrate Pro

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘war-cut.gif’ LIMIT 1′ at line 1

96 answers

Profile photo of ubdev Staff 98150.00 $tone March 26, 2017
Public

Hi there,
As our team is off now for the weekend, please give us sometime to follow up your question. Our technical team will get back to as soon as possible within today though. 
Thanks for your patience.
Regards,
Ubertheme team

#1
Profile photo of ubdev Staff 98150.00 $tone March 26, 2017
Public

Hi there, 
It seems your Magento 1 database has bad data portion that caused the issue. Please provide us the admin, ssh credentials and web root folder path of your Magento 2 site, we will check and help you out.
PS. Please use the ‘private’ reply, then your site credentials will be kept confidential.  
Regards,
 

#2
Profile photo of Mall Staff 184060.00 $tone March 27, 2017
Public

Hi sunny-dodeja305,
I’m in my home now. Let’s enable debug mode of our tool by bellow steps:
Open the php file at pub/ub-tool/index.php
and find to the code lines:
#ini_set(‘display_errors’, 1);
and replace it by code line:
ini_set(‘display_errors’, 1);
And find to the code line:
#defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);
and replace it by code line:
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);
Once done, let’s re-run data migration in the step #5 of our tool by cli command:
php -f bin/ubdatamigration run --step=5
And then, provide me the full content of the log file of our tool at:
pub/ub-tool/protected/runtime/ub_data_migration.log
I will check further and tell you work around to solve that.
Regards,
Mall.

#14
Profile photo of Mall Staff 184060.00 $tone March 28, 2017
Public

Hi there,

SELECT * FROM `catalog_product_entity_media_gallery` `t` WHERE attribute_id = 90 AND value = ‘/e/n/engine-block-man-o’war-cut.gif’ LIMIT 1

To handle that issue, let’s open the php file at path: pub/ub-tool/protected/controllers/Step5Controller.php
and find to the code line:

$condition = "attribute_id = {$attributeId2} AND value = '{$model->value}'";

and replace it by code line:

$condition = "attribute_id = {$attributeId2} AND value = '".addslashes($model->value)."'";

And then, you can continue with data migration in the step #5 and other steps.
Regards,
Mall.
 
 

#17
Profile photo of Mall Staff 184060.00 $tone March 31, 2017
Public

Hi there,

After .html there is one more suffix .

Let’s do steps as bellow to solve that issue:
Step 1: Backup current your Magento2 database migrated.
Step 2: Run bellow sql in your Magento2 database:

UPDATE url_rewrite SET request_path = REPLACE(request_path, '.html.html', '.html');

UPDATE url_rewrite SET request_path = REPLACE(request_path, '-html.html', '.html');

 
Step 3: Clear all cache of Magento and your browser and access it
Regards,
Mall.

#19
Profile photo of Mall Staff 184060.00 $tone March 31, 2017
Public

Hi there,

I just want to make sure before run sql query

Let’s do it ASAP to solve the issue as you mentioned.
Regards,
Mall.

#22
Profile photo of Mall Staff 184060.00 $tone March 31, 2017
Public

Hi there,
I think that issue come from you have bad data in url_rewrite table, which was not compatible with new rules of Magento2.
For that case, let’s try with steps as bellow:
Step 1: Run bellow sql in your database:
Delete From url_rewrite Where entity_type = ‘category’ OR entity_type = ‘product’;
Delete From catalog_url_rewrite_product_category;
Step 2: Open and re-save all your categories migrated to re-generate your catalog rewrite urls.
Regards,
Mall.

#24
Profile photo of Mall Staff 184060.00 $tone March 31, 2017
Public

Hi there,
Let’s go to PRODUCTS/Products/Inventory/Categories menu item in back-end of your site.
And then, click to open and click to save button for your category.
Regards,
Mall.

#26
Profile photo of Mall Staff 184060.00 $tone March 31, 2017
Public

Yeah, you have to do it for each category. But that because your old data has some records was not compatible with new rules of your Magento2.
You should back-up current your database before you do as my suggesting. 
Regards,
Mall.

#28
Profile photo of Mall Staff 184060.00 $tone April 1, 2017
Public

Hi there,

Ok, is there any other easy way, its bit complicated, please?

As you mentioned, your data migrated has some bad data which was not compatible with new working rules of Magento2.
And that steps are best way for your case. After that, Magento2 will re-generates category and product urls.
Regards,
Mall.

#32
Profile photo of Mall Staff 184060.00 $tone April 2, 2017
Public

Hi there,

I migrated customers too but i can’t see in dashboard it says “No such entity.”

You have to re-index your data after migrate to see your customers in grid view.

#1054 -- Unknown column ‘‘category’’ in ‘where clause’

You have got that issue in what step of our tool? Let’s provide me the log file of our tool at: pub/ub-tool/protected/runtime/ub_data_migration.log
Regards,
Mall.

#35
Profile photo of sunny.dodeja305 870.00 $tone April 2, 2017
Public

I already ran reindex command lin, You have to re-index your data after migrate to see your customers in grid view.? which command line i need to run please?
 
https://we.tl/7dQXMB7hpp You can download log file from link
 
let me know if you have any question?
 
Do you have skype?
 

#36
Profile photo of Mall Staff 184060.00 $tone April 2, 2017
Public

Hi there,

#1054 — Unknown column ‘‘category’’ in ‘where clause’

I can’t find that issue in the log of our tool. Seem you got that issue with sql command as my suggesting in first reply. It seem you have use wrong sql. You should do steps as bellow:
Step 1: Run bellow sql in your database:

Delete From url_rewrite Where entity_type = 'category' OR entity_type = 'product';
Delete From catalog_url_rewrite_product_category;

Step 2: Open and re-save all your categories migrated to re-generate your catalog rewrite urls.
Regards,
Mall.

#37
Profile photo of sunny.dodeja305 870.00 $tone April 2, 2017
Public

DELETE FROM url_rewrite WHERE entity_type = ‘category’ OR entity_type = ‘product’;# MySQL returned an empty result set (i.e. zero rows).
DELETE FROM catalog_url_rewrite_product_category;# MySQL returned an empty result set (i.e. zero rows).

#38
Profile photo of Mall Staff 184060.00 $tone April 2, 2017
Public

Hi there,

is that correct?

Yes, Maybe you have done that sql in first time. Let’s continue as my suggesting in first reply.
Regards,
Mall.

#40
Profile photo of Mall Staff 184060.00 $tone April 3, 2017
Public

Hi there,

Sorry, we’re unable to complete this request. 

Why you can’t do it? Let’s provide me the admin and ssh credentials of your Magento2 site.
Regards,
Mall.

#48
Profile photo of sunny.dodeja305 870.00 $tone April 3, 2017
Public

I need your ip address to grant ssh access.
One more thing when I try to create new product i got this error 
“Invalid entity_type specified” it was working fine before migration? Any idea How to resolve thanks!

#49
Profile photo of Mall Staff 184060.00 $tone April 3, 2017
Public

Hi there,
Bellow are our office’s IPs:
113.190.252.133
118.70.176.221
113.190.254.239
Let’s provide me the admin credentials, ssh credentials and web root folder path of your Magento2.
I will check further and reply you later.
Regards,
Mall.

#50
Profile photo of Mall Staff 184060.00 $tone April 4, 2017
Public

Hi sunny-dodeja305,
I have check your migrated database via Terminal and see the tables related to customer are in place now.
At this time, I have not found the root of issue related to Customer grid view in your back-end yet.
Could you please provide me with more information, what are steps you did before you when you got this issue? And did you install third party extensions before or after data migration? And did you make any changes to your database after migration? 
Also, I see you have installed a lot of third-party extensions in your site now. Can you try to disable all third-party extensions so that we can debug and verify the migrated data issue first? 
Regards,
Mall.

#59
Profile photo of Mall Staff 184060.00 $tone April 4, 2017
Public

Hi there,
Also please provide me more the phpmyadmin credentials of your database. As it helps me debug faster than via terminal. 
Regards,
Mall.

#60
Profile photo of sunny.dodeja305 870.00 $tone April 4, 2017
Public

Actually we didn’t make any major changes after migration, we can disable plugin, i also have backup copy after migration so i will try to unzip and ran it to make sure give me 1-2 hours to complete this process.
 
 
Thanks

#62
Profile photo of Mall Staff 184060.00 $tone April 5, 2017
Public

Hi there,

1.Customers Data {no such entity}
2.Can’t add new products {
Invalid entity_type specified:}

It is hard for me to detect the issues you mentioned in your instance now.
I have just made a back-up of your Magento1’s database to the file at: /home/devteagu/dev.teaguecustommarine.com/html/sunny_dodeja305_mg17x.sql.tar.gz
I need more time to proceed a testing migration with your database in my local. I will keep you updated once I can complete this step and debug the the issue. 
Thanks for your patience.
Regards,
Mall.

#70
Profile photo of Mall Staff 184060.00 $tone April 5, 2017
Public

Hi there,
I have finished data migration with your Magento1’s database in my local: http://i.prntscr.com/3b446a3fa0714636a1c3963a2144f14d.png

1.Customers Data {no such entity}
2.Can’t add new products {
Invalid entity_type specified:}

I have checked again that issue after migration but I did not see that issues in my local instance:
You can see this for reference: http://i.prntscr.com/3e8b64022e3640fdabb2e71e3c8c5ca8.png
=> I can see all migrated Customers in back-end after re-indexing migrated data.
And I can access Add New Product form normally: http://i.prntscr.com/15216f4de74a4fe8940ce7e1dec842f5.png
So, we can confirm that, the issues in your instance comes from your customized settings or third-party extensions which you installed in your web site.
If you want, I can share you the back-up file of your database that I migrated in my local.
As your data volume is not big, please consider to re-migrate your data following steps below:
Step 1: Install a fresh Magento2.1.5 instance.
Step 2: Re-download the latest package of our tool -- v3.0.6 (You should re-download our package, because we have added more tweak code to handle some special cases with bad data, including one case as you mentioned in product data)
And then, install our tool to your new site.
Step 3: Start data migration with steps as our guide in the Readme.html included.
Step 4: Verify all your migrated data.
Step 5: Once done, you can install more third-party themes/extensions.
Regards,
Mall.

#74
Profile photo of sunny.dodeja305 870.00 $tone April 5, 2017
Public

Yes please share files and database, is there any way i can shift all the pages and other staff from old instance? 
Can i use your backup copy as you already migrated is that work?

#76
Profile photo of sunny.dodeja305 870.00 $tone April 5, 2017
Public

SQL query:
INSERT INTO `url_rewrite` VALUES (204417,’product’,942,’ss-flexible-drive-shower-1800.html’,’ss-flexible-drive-shower-2290.html’,301,2,NULL,0,NULL),(204418,’product’,942,’bravo-drive-showers/ss-flexible-drive-shower-1710.html’,’bravo-drive-showers/ss-flexible-drive-shower-2200.html’,301,2,NULL,0,’a:1:{s:11:\”category_id\”;i:174;}’),(204419,’product’,942,’ss-flexible-drive-shower-1800.html’,’ss-flexible-drive-shower-2290.html’,301,3,NULL,0,NULL),(204420,’product’,942,’bravo-drive-showers/ss-flexible-drive-shower-1710.html’,’bravo-drive-showers/ss-flexible-drive-shower-2200.html’,301,3,NULL,0,’a:1:{s:11:\”category_id\”;i:174;}’),(204421,’product’,942,’ss-flexible-drive-shower-1814.html’,’ss-flexible-drive-shower-2290.html’,301,2,NULL,0,NULL),(204422,’product’,942,’bravo-drive-showers/ss-flexible-drive-shower-1724.html’,’bravo-drive-showers/ss-flexible-drive-shower-2200.html’,301,2,NULL,0,’a:1:{s:11:\”category_id\”;i:174;}’),(204423,’product’,942,’ss-flexible-drive-shower-1814.html’,’ss-[…]
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''oil' at line 1 
 
getting error while import db

#79
Profile photo of sunny.dodeja305 870.00 $tone April 5, 2017
Public

ERROR 1064 (42000) at line 11090: You have an error in your SQL syntax; check th e manual that corresponds to your MySQL server version for the right syntax to u se near ”oil’ at line 1
 
same error from ssh too

#85
Profile photo of Mall Staff 184060.00 $tone April 8, 2017
Public

Hi there,

I am getting .html.html issue,

That issue because your database has some bad data in the value of url_key and  request_path attributes in product section.
To solve that, let’s do steps as bellow:
Step 1: Run bellow sql in your database:

UPDATE catalog_category_entity_varchar SET value = REPLACE(value, '.html/', '/') WHERE attribute_id = 118;
UPDATE catalog_category_entity_varchar SET value = REPLACE(value, '.html', '') WHERE attribute_id = 118;
UPDATE catalog_product_entity_varchar SET value = REPLACE(value, '.html', '') WHERE attribute_id = 120;
DELETE FROM url_rewrite WHERE entity_type = 'category' OR entity_type = 'product';
DELETE FROM catalog_url_rewrite_product_category;

Step 2: Once done, let’s open and re-save for each Category migrated in back-end of your site. Magento will re-generate related catgory and product urls.
Regards,
Mall.

#90
Profile photo of sunny.dodeja305 870.00 $tone April 10, 2017
Public

Thanks that’s solved the problem, however there is one More issue in url structure in old site the sub category is set without parent category name but in magento 2 after migration url generated with parent category name on sub category url any idea how to resolve?

#91
Profile photo of Mall Staff 184060.00 $tone April 10, 2017
Public

Hi there,

however there is one More issue in url structure in old site the sub category is set without parent category name

I don’t see there is such an option in Magento 1.x default to exclude parent category path in category urls. It seem comes from your third-party extension or customized code of Magento1.

but in magento 2 after migration url generated with parent category name on sub category url any idea how to resolve?

That is default working rules of Magento2 core. It is not related to our tool.
In case you wish to customize that, you can follow this post: http://magento.stackexchange.com/questions/134988/how-to-remove-parent-category-from-subcategory-url/140363
Regards,
Mall.
 

#92
Profile photo of sunny.dodeja305 870.00 $tone September 22, 2017
Public

Hello Mall, 

I hope you are doing well, I am just finished with my project and in the process to get recent sales and customers, But after i migrated the last product I removed UB tool because I installed fresh magento 2-3 times and now when i try to update sales it says migrate product first but I already have product and I don’t want to migrate that, can you please assist me with that i really appreciate thanks!

#93
Profile photo of sunny.dodeja305 870.00 $tone September 23, 2017
Public

Hello, 
 
I am almost finish with the migration thats just last step which i need help, but I’ll surely purchase your subscription again in next 1-2 months because i got one more website but i need to sign off from this one so please help i would appreciate. 
 
Thanks! 
 

#95

Please login or Register to Submit Answer

Written By

Comments