Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

copy database between development and live servers
 
uni-man
Member
 
Total Posts:  34
Joined:  2008-04-04
 

Hi
I have got a development server with the products and categories configured just how i want. Uploading the software is fine, but when I try and upload the database I get an error (see below).

SQL query:

--
-- Constraints for table `catalog_category_entity_int`
--
ALTER TABLE `catalog_category_entity_int` ADD CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` FOREIGN KEY ( `attribute_id` ) REFERENCES `eav_attribute` ( `attribute_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ENTITY` FOREIGN KEY ( `entity_id` ) REFERENCES `catalog_category_entity` ( `entity_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY ( `store_id` ) REFERENCES `core_store` ( `store_id` ) ON DELETE CASCADE ON UPDATE CASCADE ;

MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`orgpromage/#sql-d8_84`, CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I assumed this was because phpMyAdmin exported the tables in alphabetic order, but the foreign key constraints require a different order. I tried disabling foreign keys in the phpMyAdmin export but got a “headers already sent” error when I tried to view the site…

What is the “proper” way to upload a configured database to a production server?

thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
uni-man
Member
 
Total Posts:  34
Joined:  2008-04-04
 

I found this:
http://www.magentocommerce.com/boards/viewthread/2921/#t12466
but it doesn’t help because I do not have ssh access (only via phpymyadmin)

 
Magento Community Magento Community
Magento Community
Magento Community
 
uni-man
Member
 
Total Posts:  34
Joined:  2008-04-04
 

The sql statements posted by moshe did the trick: add them at the top and bottom of your sql file and a phpmyadmin import works fine. But I still have the “headers already sent” error…

 
Magento Community Magento Community
Magento Community
Magento Community
 
uni-man
Member
 
Total Posts:  34
Joined:  2008-04-04
 

FYI, the error message is
Cannot send headers; headers already sent in /Users/stevep/Documents/lss/projects/organicproduce.co.nz/magento/app/code/core/Mage/Core/functions.php, line 191

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top