5

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.

2

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.

0

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

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;SET NAMES utf8;SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

And at the end of the SQL file add these lines

SET SQL_MODE=@OLD_SQL_MODE;SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;SET SQL_NOTES=@OLD_SQL_NOTES;
0

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.