Magento2 data migration tool issue..

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

Profile photo of Mall Staff 184060.00 $tone February 16, 2016
Public

 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.

#3
Profile photo of t f 160.00 $tone March 9, 2016
Public

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

#4
Profile photo of Mall Staff 184060.00 $tone March 10, 2016
Public

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:

Magento Custom Service


Regards,
Mall.
 
 
 

#5
Profile photo of t f 160.00 $tone March 10, 2016
Public

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.

#6
Profile photo of Mall Staff 184060.00 $tone March 14, 2016
Public

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.

#9
Profile photo of Mall Staff 184060.00 $tone March 15, 2016
Public

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.

#11
Profile photo of t f 160.00 $tone March 21, 2016
Public

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.

#12
Profile photo of Mall Staff 184060.00 $tone March 21, 2016
Public

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.

#13
Profile photo of t f 160.00 $tone March 21, 2016
Public

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.

#14
Profile photo of Mall Staff 184060.00 $tone March 21, 2016
Public

Hi t f,
In your case you have to add function as below:

public function primaryKey() {
return array('class_id');
}

Regards,
Mall.

#15
Profile photo of t f 160.00 $tone April 5, 2016
Public

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

#18
Profile photo of Mall Staff 184060.00 $tone April 6, 2016
Public

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.

#19
Profile photo of ashok kumar 10.00 $tone January 16, 2020
Public

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

#20

Please login or Register to Submit Answer

Written By

Comments