Magento – Importing old SQL database

If an old database will be transferred to a new Magento System (what does not always and not without its problems), can be attempted the following way:

It is created in phpMyAdmin, a DB backup of the corresponding DB.

>BEFORE< it is now played in the new database, should be placed at the very beginning of the downloaded DB the following lines:

SET SQL_MODE='';
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';

The end of the file should then:

SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'');
SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0);

Then all save and import into the database.

Used in Magento 1.4.1.1
Found in: http://www.magentocommerce.com/boards/viewthread/8302/#t30437

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *