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

Migrating Magento
 
garyhe
Member
 
Total Posts:  33
Joined:  2008-03-31
 

Hi,

Are there any considerations involved with migrating an installation from one server to another besides tarring the entire folder and dumping it onto the new server and then exporting/importing the sql table?

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pauljg1
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2008-02-22
 

Hello,

this is a very new open source commerce solution, but i may say if you are changing servers and the servers are not within the same hosting company or your hosting company has there reasons not to do a seemless migration. This has nothing to do with magento. Or maybe you have worded your question incorrectly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
garyhe
Member
 
Total Posts:  33
Joined:  2008-03-31
 

I’m not complaining or anything. I’m just asking if this is doable.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pauljg1
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2008-02-22
 
garyhe - 16 May 2008 12:18 PM

I’m not complaining or anything. I’m just asking if this is doable.

Yes im sure its do-able but only by what you have said prevously.  To move any database from one server to another be it Joomla or Magento the backup and restore of folders and database are the sound solution.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@garyhe: before importing database dump to new database make sure to run these statements first:

SET SQL_MODE='';
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKSFOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODESQL_MODE='NO_AUTO_VALUE_ON_ZERO';
After import run these to restore original modes:
SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'');
SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0);
 
Magento Community Magento Community
Magento Community
Magento Community
 
garyhe
Member
 
Total Posts:  33
Joined:  2008-03-31
 

Thank you all

 
Magento Community Magento Community
Magento Community
Magento Community
 
nabuhonodozor
Member
 
Avatar
Total Posts:  51
Joined:  2008-03-27
 

Moshe, Should I make this statements in phpMyAdmin?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@nabuhonodozor: add them to the beginning and the end of your db dump file before importing it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adam_Shuy
Member
 
Avatar
Total Posts:  51
Joined:  2008-02-20
San Jose, CA
 

I follow the advice from Moshe and migrate Magento from server to localhost.  But when I click the link in the localhost home page, it goes back to the original server not the localhot.  Do you have any idea how to fix this problem?
Problem solved:  change the base_url from http://www.epacificweb.com to /localhost/magento in sql file, then import the sql file to the local machine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kirubakar
Jr. Member
 
Total Posts:  2
Joined:  2009-01-09
 

Hi,Moshe

I did what you said, but am getting error. Plz Help me. Before importing the data, i ran the query
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’;

Then after I dump the all table, While dump the table I got the error like,
#1452 - Cannot add or update a child row: a foreign key constraint fails (`ayuryoga_magento/#sql-f60_70`, CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE)

Then after I ran the query Like
SET SQL_MODE=IFNULL(@OLD_SQL_MODE,’’);
SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0);

but Again I got the error like

SQL query:

SET FOREIGN_KEY_CHECKS = IFNULL( @OLD_FOREIGN_KEY_CHECKS , 0 ) ;

MySQL said: Documentation
#1231 - Variable ‘foreign_key_checks’ can’t be set to the value of ‘0’

May I know What i should do, Plz Help me

 
Magento Community Magento Community
Magento Community
Magento Community
 
tiamot
Jr. Member
 
Total Posts:  4
Joined:  2008-09-18
 
kirubakar - 14 January 2009 02:39 AM

Before importing the data, i ran the query ...

I think your problem is that maybe you ran the statements from a different session and then ran the import.
What you need to do is add the SET commands to the beginning and end of the dump file before you import it.
When you create a database backup it creates a text file with all the commands to create and then populate the database tables.
You need to add the SET command in the beginning of the file to tell the database to ignore certain checks during the import, and then at the end of the script to tell the database to turn that checking back on.

Hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
 
rami
Jr. Member
 
Total Posts:  18
Joined:  2009-01-12
 

when trying to import my old database into a clean install of magento 1.3.1.1 im getting this on edit product page:

Warning: include(Mage/Catalog/Model/Product/Attribute/Source/Layout.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/magento/app/code/core/Mage/Core/functions.php on line 73

Trace:
#0 /var/www/html/magento/app/code/core/Mage/Core/functions.php(73): mageCoreErrorHandler(2, ‘include(Mage/Ca...’, ‘/var/www/html/m...’, 73, Array)
#1 /var/www/html/magento/app/code/core/Mage/Core/functions.php(73): __autoload()
#2 [internal function]: __autoload(’Mage_Catalog_Mo...’)
#3 /var/www/html/magento/app/code/core/Mage/Core/Model/Config.php(964): class_exists(’Mage_Catalog_Mo...’)
#4 /var/www/html/magento/app/Mage.php(317): Mage_Core_Model_Config->getModelInstance(’catalog/product...’, Array)
#5 /var/www/html/magento/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(367): Mage::getModel(’catalog/product...’)
#6 /var/www/html/magento/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(199): Mage_Eav_Model_Entity_Attribute_Abstract->getSource()
#7 /var/www/html/magento/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(52): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset), Array)
#8 /var/www/html/magento/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(139): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm()
#9 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(642): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()
#10 /var/www/html/magento/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(78): Mage_Core_Block_Abstract->toHtml()
#11 /var/www/html/magento/app/code/core/Mage/Core/Block/Abstract.php(199): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout()
#12 /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php(445): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#13 /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php(229): Mage_Core_Model_Layout->addBlock(’Mage_Adminhtml_...’, ‘product_tabs’)
#14 /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php(195): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#15 /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php(200): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#16 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(295): Mage_Core_Model_Layout->generateBlocks()
#17 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(223): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#18 /var/www/html/magento/app/code/core/Mage/Adminhtml/Controller/Action.php(238): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#19 /var/www/html/magento/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(209): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#20 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(367): Mage_Adminhtml_Catalog_ProductController->editAction()
#21 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(247): Mage_Core_Controller_Varien_Action->dispatch(’edit’)
#22 /var/www/html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /var/www/html/magento/app/Mage.php(457): Mage_Core_Controller_Varien_Front->dispatch()
#24 /var/www/html/magento/index.php(52): Mage::run()
#25 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
aimrob
Jr. Member
 
Total Posts:  12
Joined:  2009-01-18
 

I have some newbie questions:

1) Am I supposed to cut and paste this code into thebeginning and end of the dump file in txt format

2) I tried to open my database file in notepad and add this to it and the file is so large that it won’t open.  Do you have any suggestions as to another program I should be using or alternative ways I can accomplish this.

Thanks in advance!  wink ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ogray
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2010-04-02
 
garyhe - 16 May 2008 11:24 AM

Hi,

Are there any considerations involved with migrating an installation from one server to another besides tarring the entire folder and dumping it onto the new server and then exporting/importing the sql table?

Thank you.

You’ll need to move files anyway. You can have fresh Magento installation on new server.
Then you’ll need to move database via SQL dump and edit some things to suite the new server environment.
It’s not so easy for non-tech people.

Details - http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server

There’s also online server for data migration - Cart2Cart - I used it for oscommerce to magento migration and it could work for Magento to Magento migration

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