During migration get error SQLSTATE[42000]

Dear Ubertheme Team,
I have installed and completed all Pre-migration Setting (8) steps. When I start migration, I’ve got the error:
Step #1:
2022/09/30 08:17:56 [error] [ub_data_migration] 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 MariaDB server version for the right syntax to use near ‘offset) FROM ub_migrate_map_step_2 WHERE entity_name = ‘core_website” at line 1. The SQL statement executed was: SELECT MAX(offset) FROM ub_migrate_map_step_2 WHERE entity_name = ‘core_website’
Step #2:
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 MariaDB server version for the right syntax to use near ‘offset) FROM ub_migrate_map_step_3 WHERE entity_name = ‘eav_attribute_set” at line 1. The SQL statement executed was: SELECT MAX(offset) FROM ub_migrate_map_step_3 WHERE entity_name = ‘eav_attribute_set’
There is the error at every step.
Help me please to solve this problem.
Bets regards,
Vladimir

18 answers

Profile photo of Mall Staff 184060.00 $tone September 30, 2022
Public

Hi there,
The issue you mentioned is strangled. Please provide me with information about your instance:
+ Admin credentials and URL to the backend
+ SSH credentials and let me know the path to the M2 folder
I will help to check further and get back to you then.
Regards,
Mall.

#1
Profile photo of ubdev Staff 98150.00 $tone October 3, 2022
Public

Hi Vladimir,
 

Where can I send you information?

You can send your info in your reply here and mark it as Private, then only our official support staff can view it.

#3
Profile photo of Mall Staff 184060.00 $tone October 4, 2022
Public

Hi there,

I checked in your instance and saw the issue you mentioned: http://prntscr.com/KuQOMUFJOXFe
Here is a sample issue when running the same SQL directly in your MySQL database: http://prntscr.com/lpK395pjyV03
The issue is to the configuration of your MySQL version 10.6.7-MariaDB-2ubuntu1.1  so you can try following these steps to solve it:

1. Open the PHP file at path: pub/ub-tool/protected/models/UBMigrate.php
and find the code line:

$query = "SELECT MAX(offset) FROM {$tableName} WHERE entity_name = '{$entityName}'";

and replace with this code line:

$query = "SELECT MAX(`offset`) FROM {$tableName} WHERE entity_name = '{$entityName}'";

2. Once done, continue with the data migration steps of our tool.

FYI: I did add the needed tweak codes suggested in step #1 for your instance.
 

Regards,
Mall.
 
 

#5
Profile photo of Mall Staff 184060.00 $tone October 5, 2022
Public

Hi there,

But when I reload the main page of the store, nothing changed (no categories, no products, no pictures). There is no thumbnails (product images) at backend/catalog/products as well.

It’s because you have not set the migrated website (code = base_migrated) as the default website in your M2 instance: http://prntscr.com/s1zhgYbpuLRa
Please try to set the website which has code = ‘base_migrated’ as the default website in the Stores management in the backend. Once done, reindex the data and clean the M2 cache.
Let me know how it goes then.
 

Regards,
Mall.

#8
Profile photo of alexander72951 150.00 $tone October 5, 2022
Public

Hi Mall,
I set the website which has code = ‘base_migrated’ as the default website.
I reindex the data at the moment, but web site shows “Server Error 500 / Internal Server Error” already.
https://compassionate-mcnulty.92-205-160-224.plesk.page
The images from folder pub/media/catalog/product/…. doesn’t load at browser: same server error 500
for example:

Updated: reindex finished but front page is still with “Server Error 500 / Internal Server Error”.
Updated: I followed this article:
https://community.magento.com/t5/Installing-Magento-2-x/500-error-internal-server-error-after-installing-magento-2-2-5/m-p/105395#M4612
I ran:
php bin/magento deploy:mode:set developer
find . -type d -exec chmod 500 {} \;
find . -type f -exec chmod 400 {} \;
find var/ -type f -exec chmod 600 {} \;
find media/ -type f -exec chmod 600 {} \;
find var/ -type d -exec chmod 700 {} \;
find media/ -type d -exec chmod 700 {} \;
$ php bin/magento cache:flush
Class “Magento\Framework\App\ResourceConnection\Proxy” does not exist
I get the error even in backend: Server Error 403 Forbidden

Help please to solve this problem?
 
Regards,
Vladimir

#9
Profile photo of Mall Staff 184060.00 $tone October 6, 2022
Public

Hi there,

I ran:
php bin/magento deploy:mode:set developer

$ php bin/magento cache:flush
Class “Magento\Framework\App\ResourceConnection\Proxy” does not exist
I get the error even in backend: Server Error 403 Forbidden
Help please to solve this problem?

It’s not recommended for you to do that. I’ve helped to re-update permission for folders and files in the root of your M2 instance by running the following command:

sudo find . -type f -exec chmod 664 {} +;
sudo find . -type d -exec chmod 775 {} +;
sudo chown -R www-data:www-data .;

Then the 500 error you mentioned was solved. However it another issue with permission was raised:

Fatal error: Uncaught Zend_Cache_Exception: cache_dir “/var/www/vhosts/compassionate-mcnulty.92-205-160-224.plesk.page/httpdocs/var/page_cache” is not writable in /var/www/vhosts/compassionate-mcnulty.92-205-160-224.plesk.page/httpdocs/vendor/magento/zendframework1/library/Zend/Cache.php:209 Stack trace: 

It seems that it still has the wrong owner of folders and files. Please contact the system admin of your M2 server for help and get the right permission of folders and files in your M2 root folder.
 

Regards,
Mall.

#10
Profile photo of Mall Staff 184060.00 $tone October 6, 2022
Public

Hi there,

What do you recommend:
should we change back to production mode or stay with developer?

As mentioned in reply #10, it’s related to the permission of folders/files on your server only. Please contact your system admin to get help for this matter.
I tried to correct the permission of folders/files in your instance with normal cases, however it didn’t work.
 
Regards,
Mall.

#12
Profile photo of alexander72951 150.00 $tone October 6, 2022
Public

Hi Mall,
I changed permission. 
Now the frontend and backend with Server Error 500.
 
Updated: backend is working now, but there is no migrated data (categories, products, sales, …)

Can you look?
 
Regards,
Vladimir

#13
Profile photo of Mall Staff 184060.00 $tone October 7, 2022
Public

Hi there,

Updated: backend is working now, but there is no migrated data (categories, products, sales, …)
Can you look?

I checked further in your instance but couldn’t access the catalog > products menu.
Apparently you have not deploy static files on your site successfully yet: http://prntscr.com/T7YWJZR-SMOH . Please consider re-deploying the static files on your site, then check for the issue you mentioned again.
 

Regards,
Mall.

#14
Profile photo of alexander72951 150.00 $tone October 7, 2022
Public

Hi Mall,

When I ran:
$ php bin/magento setup:static-content:deploy

I’ve got the message:
In DeployStaticContentCommand.php line 158:
NOTE: Manual static content deployment is not required in “default” and “developer” modes.
In “default” and “developer” modes static contents are being deployed automatically on demand.
If you still want to deploy in these modes, use -f option: ‘bin/magento setup:static-content:deploy -f’

Should I run this command or better to change the mode to production and then deploy static?
 
**Updated: I ran the command:
bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
 
The sidebar menu in backend doesn’t work, except Dashboard and UB Data Migration Pro

Regards,
Vladimir

#15
Profile photo of Mall Staff 184060.00 $tone October 10, 2022
Public

Hi there,

Should I run this command or better to change the mode to production and then deploy static?

That is related to Magento core CLI commands.
You can learn more about this from Mageto’s guide.
 

Regards,
Mall.
 

#16
Profile photo of alexander72951 150.00 $tone October 11, 2022
Public

Hi Mall,
 
I changed back the mode to production, changed permission, made deploy of static-content but still the sidebar menu in backend doesn’t work, except Dashboard and UB Data Migration Pro
 
Regards,
Vladimir

#17
Profile photo of Mall Staff 184060.00 $tone October 12, 2022
Public

Hi there,

I changed back the mode to production, changed permission, made deploy of static-content but still the sidebar menu in backend doesn’t work, except Dashboard and UB Data Migration Pro

In this case please contact the system admin of your site to get further help on the deploy static files functions. That is related to Magento’s core function and not related to our migration tool.
 

Regards,
Mall.

#18

Please login or Register to Submit Answer

Written By

Comments