Erreurs suite à une migration de serveur magento
décembre 8, 2009 1 CommentairesCe tutoriel recense toutes les erreurs de base de données ou autres que j’ai rencontrées lors d’un changement de serveur. Serveur local vers serveur distant. Les principales barrières sont les différentes versions de base de données ou php. Essayez d’avoir des versions similaires ou proches. Avant de débuter la migration testez votre serveur pour vérifier s’il est compatible avec magento.
Cannot add or update a child row:
Voici l’erreur complète :
requête SQL: -- -- Contraintes pour la table `eav_entity_attribute` -- ALTER TABLE `eav_entity_attribute` ADD CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY ( `attribute_id` ) REFERENCES `eav_attribute` ( `attribute_id` ) ON DELETE CASCADE ON UPDATE CASCADE , ADD CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_GROUP` FOREIGN KEY ( `attribute_group_id` ) REFERENCES `eav_attribute_group` ( `attribute_group_id` ) ON DELETE CASCADE ON UPDATE CASCADE ; MySQL a répondu:Documentation #1452 - Cannot add or update a child row: a foreign key constraint fails (`buggy/#sql-6a21_c1`, CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE)
La solution consiste à désactiver la vérification des clés primaires.

Avant d'exporter la base de données, désactivez la vérifications des clés étrangères
Structure de la table `catalog_category_entity_varchar`
Cette table pose souvent problème. Voici le message d’erreur complet :
requête SQL: -- -------------------------------------------------------- -- -- Structure de la table `catalog_category_entity_varchar` -- CREATE TABLE IF NOT EXISTS `catalog_category_entity_varchar` ( `value_id` int( 11 ) NOT NULL AUTO_INCREMENT , `entity_type_id` smallint( 5 ) unsigned NOT NULL DEFAULT '0', `attribute_id` smallint( 5 ) unsigned NOT NULL DEFAULT '0', `store_id` smallint( 5 ) unsigned NOT NULL DEFAULT '0', `entity_id` int( 10 ) unsigned NOT NULL DEFAULT '0', `value` varchar( 255 ) NOT NULL DEFAULT '', PRIMARY KEY ( `value_id` ) , UNIQUE KEY `IDX_BASE` ( `entity_type_id` , `entity_id` , `attribute_id` , `store_id` ) USING BTREE, KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` ( `entity_id` ) , KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` ( `attribute_id` ) , KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` ( `store_id` ) ) ENGINE = InnoDB DEFAULT CHARSET = utf8 AUTO_INCREMENT =58; MySQL a répondu:Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE, KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`), KEY `FK_CATALO' at line 9
Après l’exportation de votre base de données ouvrez le fichier .sql (il peux se trouvé dans un fichier zip) et recherché cette table :
CREATE TABLE IF NOT EXISTS `catalog_category_entity_varchar` (
Remplacer cette ligne :
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE,
Par :
UNIQUE KEY `IDX_BASE` USING BTREE (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
Tutoriel original sur ce blog en anglais.
Fatal error: Uncaught exception ‘Exception’ with message ‘Warning: simplexml_load_file()
voici le code d’erreur complet :
Fatal error: Uncaught exception 'Exception' with message 'Warning: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: /home/magento/www/app/etc/local.xml:45: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xB5 0x35 0x34 0x66 in /home/magento/www/app/Mage.php on line 526' in /home/magento/www/app/code/core/Mage/Core/functions.php:239 Stack trace: #0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/home/magento/www...', 526, Array) #1 /home/magento/www/app/Mage.php(526): simplexml_load_file('/home/magento/www...') #2 /home/magento/www/app/Mage.php(481): Mage::isInstalled() #3 /home/magento/www/index.php(65): Mage::run() #4 {main} thrown in /home/magento/www/app/code/core/Mage/Core/functions.php on line 239
Problème d’encodage du fichier local.xml, il faut l’encoder en UTF8.
There has been an error processing your request.
Pas de connexion avec la base de données alors que tous les paramètres était correct
SQLSTATE[28000] [1045] Access denied for user 'magento'@'localhost' (using password: YES) Trace: #0 /home/magento/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(211): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 /home/magento/www/lib/Zend/Db/Adapter/Abstract.php(441): Varien_Db_Adapter_Pdo_Mysql->_connect() #2 /home/magento/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array) #3 /home/magento/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(281): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array) #4 /home/magento/www/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php(45): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8') #5 /home/magento/www/app/code/core/Mage/Core/Model/Resource.php(87): Mage_Core_Model_Resource_Type_Db_Pdo_Mysql->getConnection(Object(Mage_Core_Model_Config_Element)) #6 /home/magento/www/app/code/core/Mage/Core/Model/Resource/Setup.php(62): Mage_Core_Model_Resource->getConnection('core_setup') #7 /home/magento/www/app/code/core/Mage/Core/Model/Resource/Setup.php(120): Mage_Core_Model_Resource_Setup->__construct('core_setup') #8 /home/magento/www/app/code/core/Mage/Core/Model/Config.php(263): Mage_Core_Model_Resource_Setup::applyAllUpdates() #9 /home/magento/www/app/code/core/Mage/Core/Model/App.php(263): Mage_Core_Model_Config->init(Array) #10 /home/magento/www/app/Mage.php(434): Mage_Core_Model_App->init('', 'store', Array) #11 /home/magento/www/app/Mage.php(455): Mage::app('', 'store', Array) #12 /home/magento/www/index.php(65): Mage::run() #13 {main}
Mot de passe de connexion a la base de donnees mal encodé d41iT6fµ5hYfH£A caractère non reconnu j’ai modifié le mot de passe et la connexion à la base s’est faite.
Fatal error: Allowed memory size of 8388608 bytes exhausted
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4864 bytes) in /home/magento/www/app/code/core/Mage/Core/Model/Message/Collection.php on line 138 solution augmenter la memoire
Problème de mémoire, il faut augmenter la memoire de php dans php.ini
Notice: Use of undefined constant php – assumed ‘php’
Erreur générée sur le serveur distant et non sur le local, erreur d’inattention j’avais collé des caractères après une balise php
en local pas d’erreur sur le serveur distant avec une version différente de php erreur.
Vous avez d’autres erreurs ou solutions ?
Liens complémentaires
Problème d’accès à l’administration magento, connexion au back-office impossible
Installer magento sur un serveur distant à partir d’une installation locale (wampserver)
Vérifier la compatibilité de votre serveur avec magento
Installation de magento et Zend Serveur
Magento : problèmes rencontrés à l’installation
Configuration de wampserver pour installer magento
Installation de magento sur serveur local wampserver
merci pour ce super tuto. l’importation fonctionne alors bien, mais ensuite, lors de la suppression d’un produit, les différentes tables (ex: catalog_product_website) ne sont pas impactées car les clés étrangères ne sont plus liées.
avez-vous une idée?