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

Failure to migrate store to second server! Please help. 
 
JSTRAT
Jr. Member
 
Total Posts:  16
Joined:  2008-05-06
 

Hi I am currently working on a new store. I have created a local installation with out any problems. I now need to migrate my work to the destination server. However this fails with a strange error when I try and access the store on the new server:

SQLSTATE[23000]Integrity constraint violation1062 Duplicate entry '0' for key 1
Trace
:
#0 /var/www/html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(406): Zend_Db_Statement->execute(Array)
#2 /var/www/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(206): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
#3 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(484): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
#4 /var/www/html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(343): Zend_Db_Adapter_Abstract->insert('log_visitor', Array)
#5 /var/www/html/app/code/core/Mage/Core/Model/Abstract.php(235): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Log_Model_Visitor))
#6 /var/www/html/app/code/core/Mage/Log/Model/Visitor.php(136): Mage_Core_Model_Abstract->save()
#7 /var/www/html/app/code/core/Mage/Core/Model/App.php(1032): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#8 /var/www/html/app/Mage.php(278): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#9 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(377): Mage::dispatchEvent('controller_acti...', Array)
#10 /var/www/html/app/code/core/Mage/Core/Controller/Front/Action.php(40): Mage_Core_Controller_Varien_Action->preDispatch()
#11 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(335): Mage_Core_Controller_Front_Action->preDispatch()
#12 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(159): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /var/www/html/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch()
#15 /var/www/html/index.php(40): Mage::run()
#16 {main}

My procedure for the migration is as follows:

Copy the htdocs from source server to destination server
Create database user in mysql on destination server to match that of the source server
Export the database from the source server using phpmyadmin
Import the database into the destination server using phpmyadmin

My understanding is that this should be an exact copy of my source server. However if I try and access the store on the destination server I get the above error. If I try and access the admin system on the destination server I get in and most functions work. However trying to save changes to a product for example result in a generic “Product save error”.

I have removed the contents of the var/cache directory to make sure there is nothing conflicting from there. But nothing I do seems to work.

Also if I try and hook up my local web to the destination servers database, or the destinations web to the local database I get the above error both times. I suspect I am missing some key piece of information for this process, but I have no idea what.

This is at a critical phase of the project so any help would be excellent.

Many thanks
Jason

 
Magento Community Magento Community
Magento Community
Magento Community
 
JSTRAT
Jr. Member
 
Total Posts:  16
Joined:  2008-05-06
 

Its always the same. No sooner do you post a question and you then work out the solution!

It seems that the export on the phpmyadmin needs to have the ‘Disable Foreign Key Checks’ option selected.

Jason

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