Dear support team,
We have installed magento 2.0.2 version and migrated with magento 1.9.0.1, 1.7.0.2 versions. we have done that process success fullly.
But when we have migrated with magento 1.6x, 1.8x, and 1.9.1.0, 1.9.1.1, 1.9.2.1 versions, its showing some error like.
CDbException
Column name must be either a string or an array.
C:\xampp\htdocs\magento2_data_migration\yii\db\schema\CDbCommandBuilder.php(832).
can you guide us to fix this issue. So that we can proceed further.
kindly refer below screen shot.
Thanks in advance.
21 answers
Hi Elamguil Shanmugan,
Thank for working around with this tool.
Can you show me more detail about the issues as you said? Some details screenshot about the issue as is good.
I will check further and tell you solution to solve.
In case you might want to use our service.
Regards,
Mall.
Dear Mall,
Kindly check the link below for migration issue from magento 1x to magento 2.0.2.
https://www.dropbox.com/s/4jl5w9hqjrh3gl0/screencapture-localhost-magento2_data_migration-index-php-migrate-step6-1454671338803.png?dl=0
Kindly check it and let us guide to resolve this issue ASAP.
Thanks in advance.
Hi Elamguil Shanmugan,
That issue seem your Magento 1 database missing the primary key in the table customer_group or it’s strange that your MySQL does not return this primary key automatically.
In this case, you can open the PHP class at path /protected/models/mage1/Mage1CustomerGroup.php
and add more bellow function to that class:
public function primaryKey() {
return array('customer_group_id');
}
See more here to clear: http://i.imgur.com/U0fkGaZ.png
Let’s do it and tell me know how it goes.
Also please note that, we have released this tool as a Magento 2 module at:
https://github.com/ubertheme/module-ubdatamigration
Regards,
Mall.
Hi Mall,
I have the same issue like Elamguil Shanmugan and I also tried your solution but it dosen’t fixed it.
I add the code at the right place, restart Apache and also restart the process but it dosen’t work.
It would great if you have more Ideas
Regards,
tf
Hi t f,
Let’s share me more details about your issues.
What versions of your Magento 1 and Magento 2?
What version of this tool you are using and where did you download this tool?
I will check further and tell you solution to solve.
In case you might use our service you can submit here:
Regards,
Mall.
Hey Mall,
My versions are Magento 1.9.1.0 and Magento 2.0.2.
I used the tutorial of your guthub page to install the tool as a module:
https://github.com/ubertheme/module-ubdatamigration
The version of the module is 1.0.4
Within the install no Error appear.
After the start of Step 3 of the tool its showing the Error:
CDbException
Column name must be either a string or an array.
C:\xampp\htdocs\magento_ce_2_1\pub\ub-tool\yii\db\schema\CDbCommandBuilder.php(831)
please note that the line is 831 and not 832 as with Elamguil Shanmugan.
Thanks for your response.
Hi
I use MySQL 5.6.21 and PHP 5.6.3
Hi t f,
CDbException
Column name must be either a string or an array.
C:\xampp\htdocs\magento_ce_2_1\pub\ub-tool\yii\db\schema\CDbCommandBuilder.php(831)
Can you help provide me the screenshot a bout the issue as you said?
Regards,
Mall.
Hey Mall,
I upload some screenshots:
1: http://abload.de/img/m19_20_1isjms.jpg
At step 3 before the error message appear
2: http://abload.de/img/m19_20_27wktv.jpg
Error message part 1
3: http://abload.de/img/m19_20_3z0jo0.jpg
Error message part 2
4: http://abload.de/img/m19_20_40sj3y.jpg
Error message part 3
Regards,
tf
Hi tf,
By your screenshots, i have see that issue because the table `eav_attribute_set` in the Magento 1 database was missing the Primary Key or your MySQL does not return this primary key automatically (see more).
To solve that issue, let’s open the php class file at path: /pub/ub-tool/protected/models/mage1/Mage1AttributeSet.php
and add more below function to that class:
public function primaryKey() {
return array('attribute_set_id');
}
And you can do similar for this issue with other models/tables if exists.
Let’s do it and tell me know how it goes.
Regards,
Mall.
Hi Mall,
After I add the code to the Mage1AttributeSet.php it return the same error for the
Mage1Attribute.php.
So I tried:
Public function primaryKey() {
return array(attribute_id);
}
The same error appear for Mage1AttributeGroup.php.
So I add these on the same way to the code:
Public function primaryKey() {
return array(attribute_group_id);
}
After that it works untill Step 6. Then a similar error appear. I can’t indentify which array must return.
So unhappily I can’t solve this with these snippet.
Here are two screenshots of the error:
1: http://abload.de/img/m03_21_4ans26.jpg
Part 1
2: http://abload.de/img/m03_21_5d6sou.jpg
Part2
Regards t f.
Hi t f,
Let’s do similar with the php class file at path:
/pub/ub-tool/protected/models/mage1/Mage1TaxClass.php
and let’s me know how it goes.
Regards,
Mall.
Hey Mall,
I tried this code in Mage1TaxClass.php:
Public function primaryKey() {
return array(tax_class_id);
}
The problem is I don’t know what to insert at
return array( ??? );
At the point “Stack Trace” on the 2nd screenshot only process #2 have a border. There I get which data i must change.
At the errors on Step 3 there was also a process #3 with a border. There i got what i must enter at return array.. etc. .
Sorry for my bad explanation.
Regards,
t f.
Hi t f,
In your case you have to add function as below:
public function primaryKey() {
return array('class_id');
}
Regards,
Mall.
Hey Mall,
Now I got the same error at Step 7…
Here is a screenshot:
http://abload.de/img/m04_04_169dk7j.jpg
At the error I can’t see what to do now
Thanks in advance.
Hi tf,
Can you provide me full of the screenshot about it?
I can’t see last issue in the screenshot you are provided: http://abload.de/img/m04_04_169dk7j.jpg
I see the issue related the PHP class at /pub/ub-tool/protected/models/mage1/Mage1SalesruleCustomerGroup.php
Regards,
Mall.
Hey Mall,
Sorry for that..
Here are the new one.
#1 http://abload.de/img/m05_04_161ofm.jpg
#2 http://abload.de/img/m05_04_20aooy.jpg
That should help.
Regards,
t f
Hi t f,
Yes, that is a similar issue. Let’s solve that by solution in first reply with the PHP class at
/pub/ub-tool/protected/models/mage1/Mage1SalesruleCustomerGroup.php
You can use below function for this class:
public function primaryKey() {
return array('rule_id');
}
Let’s do it and contact me if you need further assistance!
Regards,
Mall.
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `tax_calculation_rule` (`tax_calculation_rule_id`, `code`, `priority`, `position`, `calculate_subtotal`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4)
I have this error at last 9th step plz help me
Hi Ashok,
We’ve replied to you for the same question via this ticket, please check.
Regards,
Ubertheme team