I am new to magento

I am working on product import

i have migrated my site from one domain to another but after that while importing product in my site i am getting error

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`choiccgo_shop`.`cataloginventory_stock_item`, CONSTRAINT `FK_CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK_STOCK_ID` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DEL)

I am stuch tried everything but no success.

3 Answers 3


Something is usually 'pushing' you feed down so make sure you data is 'clean'. So keep in mind .CSV UTF-8. Try to find the row that is causing the issue. This can happen from special characters as well. You can see these from using programs such as Notepad++. There is more reason, but try to have clean data is 'intergrety' in this case is looking like it's the wrong field meaning, the data is getting parsed incorrectly.


It might be because column you trying to insert doesn't exist on table. I could give you two solutions.

How are you importing the products? Is that by

System -> Import/Export -> Dataflow - Profiles -> Import All Products.

Solution 1: I would like to suggest you to import by a mass importer called magmi. It has got good wiki page which gives you a elaborate description of the plugins and all other stuffs to import inside Magento.

Solution 2: Update Quantity Separately - Click that link

Good Practices : It's always good practice use these these lines in the beginning of the SQL file which you're going to import


And at the end of the SQL file add these lines


If you want to import all products to your website, just follow the following instructions.

1. First of all, create all categories and create one product in your website,
2. After this, export that data and keep that with you.
3. Now arrange the data which you want to import, that total have to be arrange in the format of your exported data.
4. After arranged you can easily import the data into your website which you want to import newly in usual manner.
5. Then go to system-->import/Export-->Data flows-->Follow that rules...

Import & Export all products using csv file (without extension)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.